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.)

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

What are object properties?

A

Object properties are defined as a simple association between name and value.

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

Describe object literal notation.

A
  1. declare a variable
  2. the object is the curly braces and its contents
  3. separate each key form its value with a colon (property/method)
  4. separate each property/method with a comma
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you remove a property from an object?

A

Use the delete operator with the property name.

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

What are the two ways to get or update the value of a property?

A
  1. dot notation

2. bracket notation

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