Кто-нибудь может мне объяснить, почему A
истинно, а B
ложно ? Я ожидал, что B будет правдой.
function MyObject() {
};
MyObject.prototype.test = function () {
console.log("A", this instanceof MyObject);
(function () {
console.log("B", this instanceof MyObject);
}());
}
new MyObject().test();