Javascript-objects-Q&A Flashcards

1
Q

What are objects used for?

A

Object properties can be both primitive values, other objects, and functions. An object method is an object property containing a function definition. JavaScript objects are containers for named values, called properties and methods.

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

What are object properties?

A

Object properties are defined as a simple association between name and value. All properties have a name and value is one of the attributes linked with the property, which defines the access granted to the property. Properties refer to the collection of values which are associated with the JavaScript object.

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

Describe object literal notation.

A

The Object literal notation is basically an array of key:value pairs, with a colon separating the keys and values, and a comma after every key:value pair, except for the last, just like a regular array. Values created with anonymous functions are methods of your object.

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

How do you remove a property from an object?

A

The delete operator deletes both the value of the property and the property itself.

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

What are the two ways to get or update the value of a property?

A

You do this using the dot notation and square brackets

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