JavaScript-constructors Flashcards
1
Q
What does the “new” operator do?
A
Creates a new Object: creates blank object, adds prototype, finds ‘this’ and returns ‘this
2
Q
What property of JavaScript functions can store shared behavior for instances created with ‘new’?
A
prototype property
3
Q
What does the instanceOf operator do?
A
Tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object.