en.javascript.info/1-js/09-classes/06-instanceof/1-strange-instanceof/solution.md
2019-04-21 13:40:20 +03:00

7 lines
339 B
Markdown

Yeah, looks strange indeed.
But `instanceof` does not care about the function, but rather about its `prototype`, that it matches against the prototype chain.
And here `a.__proto__ == B.prototype`, so `instanceof` returns `true`.
So, by the logic of `instanceof`, the `prototype` actually defines the type, not the constructor function.