JS objects Flashcards

1
Q

What are objects used for?

A

represent something that has key-value storage related to each other in some form

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

What are object properties?

A

variables (tell us about the object)

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

Describe object literal notation.

A
curly braces and key-value pairs 
var person = {
firstName: 'Marley',
lastName: 'Doughty' }
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

delete operator objectName.property
ex)
delete person.firstName

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

dot notation or bracket notation

ex) person.age = ‘24’
ex) person[‘age’] = ‘24’

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