Objects Flashcards
What is an object ?
An object is a composite value: it aggregates multiple values (primitive values or other objects) and allows you to store and retrieve those values by name.
An object is an unordered collection of properties, each of which has a name and a value. Property names are usually strings (although, as we’ll see in §6.10.3, property names can also be Symbols), so we can say that objects map strings to values.
What are the other common names of “string-to-value” mapping structures in other programming languages ?
hash, hashtable, dictionary, associative array
What makes a javascript object something more than a simple “string-to-value” map ?
A javascript object also inherits the properties of another object, known as its “prototype”.
What are types possible for the property names of an object
String (most common one) and Symbol.
The other types are converted to String.
What are the possible values of a javascript object property ?
Any javascript value, or a getter or setter function (or both)
What is a prototype ?
A prototype is an object that make one or many other objects inherits of its properties.
Almost every javascript object has a second javascript object associated with it: its prototype.
What is the prototype of all objects created using Object Literals ?
Object.prototype