➕instanceof
`obj instanceof SomeClass`
Last updated
Was this helpful?
`obj instanceof SomeClass`
Last updated
Was this helpful?
Was this helpful?
JS ⟩ statement ⟩ expression ⟩ operator ⟩ relational ⟩ instanceof
check if SomeClass.prototype
is in the prototype chain of obj
.
obj instanceof SomeClass
if obj is not an object, instanceof returns false.
if SomeClass
is not a /function, it throws a .