var bar = {
"a": function () {
alert("Hello");
}
};
function foo() {
Object.prototype.a = 'Set from prototype';
return function inner() {
alert(bar.a());
}
}
foo()();
alert(bar.a()) execution as follows
ReplyDeletebar.a() executed //output Hello
alert( return of bar.a() which is Undefined) //output undefined