Standard built-ins
Symbol.hasInstance
Key for a custom instanceof membership predicate on the right operand; the result is converted to Boolean.
Formal Syntax & Structure
javascript syntaxjavascript
Symbol.hasInstanceReturn Value
symbol
The predefined protocol key.
Working Example
Example Snippetjavascript
const positive={[Symbol.hasInstance](x){return x>0;}};console.log(2 instanceof positive);