js objects Flashcards
1
Q
What are objects used for?
A
storing information in key/value pairs
2
Q
What are object properties?
A
key/value pairs containing variables/functions/etc for the object
3
Q
Describe object literal notation.
A
var objectExample = {
key: value,
key: value,
};
4
Q
How do you remove a property from an object?
A
delete objectName.propertyName;
also works with bracket notation
5
Q
What are the two ways to get or update the value of a property?
A
dot notation: objectName.propertyName
bracket notation: objectName[‘propertyName’]