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.

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

functions have a prototype property that can be used to store shared behavior for instances created with the new operator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

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