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
2
Q
What are object properties?
A
they are variables to which data is assigned
3
Q
Describe object literal notation
A
var variableName = { key: value, key: value }
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;
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”]