instanceof

`obj instanceof SomeClass`

JSstatementexpressionoperatorrelational ⟩ instanceof

check if SomeClass.prototype is in the prototype chain of obj.

obj instanceof SomeClass

🌟 table of operators

  • if obj is not an object, instanceof returns false.

  • if SomeClass is not a class/function, it throws a TypeError.

Last updated