javascript-constructors Flashcards

1
Q

What does the new operator do?

A
  1. creates blank JS object
  2. points new objects prototype to the prototype of the constructor function
    runs the constructor function
  3. execute constructor function and makes this refer to the new object
  4. if non primitive, then it becomes new object created
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What property of JavaScript functions can store shared behavior for instances created with new?

A

prototype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the instanceof operator do?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly