Javascript
100 Front End Interview Questions Challenge

instanceof

Mute
Current Time 0:00
/
Duration Time 0:00
Loaded: 0%
Progress: 0%
Stream TypeLIVE
Remaining Time -0:00
 
PRO

The instanceof operator returns true or false, based on whether or not the variable is of a certain type. It is meant for use on objects and classes, but not primitive types like string or number.

Using instanceof on an instance of a class will return true for both the class and object.

 

I finished! On to the next chapter