javascript-objects Flashcards
1
Q
What are objects used for?
A
An object is a collection of related data and/or functionality (which usually consists of several variables and functions — which are called properties and methods when they are inside objects.)
2
Q
What are object properties?
A
Object properties are defined as a simple association between name and value.
3
Q
Describe object literal notation.
A
- declare a variable
- the object is the curly braces and its contents
- separate each key form its value with a colon (property/method)
- separate each property/method with a comma
4
Q
How do you remove a property from an object?
A
Use the delete operator with the property name.
5
Q
What are the two ways to get or update the value of a property?
A
- dot notation
2. bracket notation