๐object
reference types
Last updated
Was this helpful?
reference types
Last updated
Was this helpful?
Was this helpful?
an unordered collection of properties (name : value pairs).
// creating objects
{name: value} // object literal
new Object() // `new` statement
let obj = Object.create(prototype) // specify an object's prototype
๐ฏ synonyms๏ผ "hash", "hashtable", "dictionary", "associated array".
most common things to do with objects๏ผ
create objects.
(get/set, / / ) their .
.valueOf() - object -> primitive (typically a number)
.toJSON() - a method expected by JSON.stringify()