javascript-constructors Flashcards
1
Q
What does the new operator do?
A
the new operator creates an instance of a user-defined object type or of one of the built-in object types that has a constructor function.
2
Q
What property of JavaScript functions can store shared behavior for instances created with new?
A
prototype property. (syntax: Function.prototype.some property = value).
3
Q
What does the instanceof operator do?
A
the instanceof operator tests if the prototype property of the constructor appears in the prototype chain of an object.