javascript-constructors Flashcards
1
Q
What does the new operator do?
A
- creates blank JS object
- points new objects prototype to the prototype of the constructor function
runs the constructor function - execute constructor function and makes this refer to the new object
- if non primitive, then it becomes new object created
2
Q
What property of JavaScript functions can store shared behavior for instances created with new?
A
prototype
3
Q
What does the instanceof operator do?
A