Objects Flashcards
1
Q
How are objects initiated?
A
Curly brackets { }
ex: const newObjc = { }
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
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
4
Q
True or False: There can be semi-colons inside of an object.
A
False - key:value pairs are separated by commas
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’