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
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
3
Q
new
A
- when invoking a function, creates an object and returns it implicitly (don’t need return keyword)
4
Q
this
A
- Implicit Binding Rule
- When method uses [this], references the object the method is called on - [New] Binding Rule
- references object [new] creates
- always references an object