"foo" instanceof String //=> false "foo" instanceof Object //=> false true instanceof Boolean //=> false true instanceof Object //=>
This is defined in the ECMAScript specification Section 7.3.19 Step 3: If Type(O) is not Object, return false.
If Type(O) is not Object, return false.
In other word, if the Obj in Obj instanceof Callable is not an object, the instanceof will short-circuit to false directly.
Obj
Obj instanceof Callable
instanceof
false