Objects Flashcards

1
Q

How are objects initiated?

A

Curly brackets { }

ex: 
const newObjc = { }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Objects use __:___ pairs to house data

A

key:value pairs

The key is the identifier and the value is the input we want to save to the key

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

True or False: There can only be one key of its given name in an object, but values can be shared with multiple keys.

A

True, keys are unique

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

True or False: There can be semi-colons inside of an object.

A

False - key:value pairs are separated by commas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
const canineUser = {
    username: 'docMcstuffins', 
    password: 'ballBallBALL',
    lovesChewing: true, 
    favoriteTime: 'walk time',
};
console.log(canineUser.lovesChewing);

What will this return?
What type of notation is this an example of?

A

‘true’

We called the lovesChewing key, which has the value ‘true’

This object is an example of ‘dot notation’

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