JS Constructors Flashcards
1
Q
What does the instanceof operator do?
A
The instanceof operator tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object. The return value is a boolean value.
2
Q
What does the new operator do?
A
Creates a blank object
Sets the constrcutor of new object to other object
Passes new object as this
Returns this if the function does not return an object
3
Q
What property of JavaScript functions can store shared behavior for instances created with new?
A
prototype property