javascript-constructors Flashcards
1
Q
What does the new operator do?
A
Creates a blank, plain JavaScript object. creates a new object - assigns prototype, assigning this keyword and returning object.
2
Q
What property of JavaScript functions can store shared behavior for instances created with new?
A
functions have a prototype property that can be used to store shared behavior for instances created with the new operator.
3
Q
What does the instanceof operator do?
A
it tells you if there is an instance of the property of an object that is passed in as an argument.