Constructor and Prototypes Flashcards

1
Q

What does the new operator do?

A

makes a new blank obj, sets the prototype of that obj to the constructor function. the ‘this’ keyword is now pointed to this obj

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

the prototype property

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

What does the instanceof operator do?

A

checks of something is a prototype of something else, returns a boolean.

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