JS objects Flashcards

1
Q

What are objects used for?

A

they are used to group together variables and functions in a collection of information

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

What are object properties?

A

they are variables to which data is assigned

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

Describe object literal notation

A

var variableName = { key: value, key: value }

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

use the delete operator, then access the property by using dot notation:

delete variableName.property;

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

bracket notation and dot notation

variableName.property

variableName[“property”]

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