var name = "Window";
var object={
name: "My Object";
getNameF:function(){
return function(){
return this.name;
}
}
};
alert(object.getNameF()()); // 为什么是Window
Var name = "Window";
var object={
name: "My Object";
getNameF:function(){
var that = this;
return function(){
return that.name;
}
}
};
alert(object.getNameF()()); //My Object