15.3.5.3 [[HasInstance]](V)

2010-07-04

boolean Function.prototype.[[HasInstance]](V:object|mixed)

Check whether the prototype of this function is equal to any prototype in the prototypial chain of V. So any Function instance is also an instance of Object, since Function inherits from Object.

Code: (Meta Ecma)
Function.prototype.[[HasInstance]] = function(V){
if (!IsObject(V)) return false;
var O = this.[[Get]]("prototype");
if (Type(O) != "Object") throw TypeError;
while (true) {
V = V.[[Prototype]];
if (V === null) return false;
if (O === V) return true;
}
}

Note that functions returned from Function.prototype.bind have a custom implementation of [[HasInstance]] (15.3.4.5.3).