根据作用域链的原理,最后this.name不应该在object里面找吗?
var name = "The Window"; var object = { name : "My Object", getNameFunc : function(){ alert("My Object "+this.name); //MyObject return function () { alert("The Window "+this.name); return this.name;//This Window } } };
相关分类