JavaScript Objects Flashcards

1
Q

What are objects used for?

A

To group together a set of variables(data) and functions(functionality) to create a model of something

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 variables within the object

Key Value Pairs - keys and values

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

Describe object literal notation

A

Object Literal Notation is an array of key:value pairs.

Key:value are separated with a colon :

Key:value pairs are separated with a coma ,

You use curly braces {} for the 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

You remove a property using dot notation with the delete operator

delete object.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

object.propertyName = ‘propertyValue’

object[‘propertyName’] = ‘propertyValue’

Use dot notation or bracket notation

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