In the code below, why does
true? We can easily see that
a is not created by
Yeah, looks strange indeed.
instanceof does not care about the function, but rather about its
prototype, that it matches against the prototype chain.
a.__proto__ == B.prototype, so
So, by the logic of
prototype actually defines the type, not the constructor function.