Standard built-ins

Function.prototype[Symbol.hasInstance]

Try the free JavaScript compiler

Default function instance test, including ordinary prototype ancestry and special delegation for bound functions. Does not verify constructor-call history.

Formal Syntax & Structure

javascript syntaxjavascript
Function.prototype[Symbol.hasInstance].call(fn, value)

Parameters & Attributes

NameTypeDescription
valueanyCandidate value.

Return Value

boolean

Ordinary instance test result.

Working Example

Example Snippetjavascript
function F(){};console.log(Function.prototype[Symbol.hasInstance].call(F,Object.create(F.prototype)));
JavaScript Reference