Objects & Factory Functions Flashcards

1
Q

Object.create

A
  • Returns a new object and creates a new object

- Assigns the new object’s internal prototype as the object passed in as an argument

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

Factory Function

A
  • create, set up, and return an object

- any object returned from a factory function is an ‘instance’ of the factory function

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

new

A
  • when invoking a function, creates an object and returns it implicitly (don’t need return keyword)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

this

A
  1. Implicit Binding Rule
    - When method uses [this], references the object the method is called on
  2. [New] Binding Rule
    - references object [new] creates
    - always references an object
How well did you know this?
1
Not at all
2
3
4
5
Perfectly