Objects Flashcards

1
Q

What is an object ?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the other common names of “string-to-value” mapping structures in other programming languages ?

A

hash, hashtable, dictionary, associative array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What makes a javascript object something more than a simple “string-to-value” map ?

A

A javascript object also inherits the properties of another object, known as its “prototype”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are types possible for the property names of an object

A

String (most common one) and Symbol.
The other types are converted to String.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the possible values of a javascript object property ?

A

Any javascript value, or a getter or setter function (or both)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a prototype ?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the prototype of all objects created using Object Literals ?

A

Object.prototype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly