var name = "小明",
person = { name : "小紅", getName : function(){
return function(){
return this.name;
};
}
};console.log(person.getName()()); // 小明為什么最后打印出來的“小明”而不是“小紅”?看不太懂person.getName()()這句后面兩個括號的意思。//新手勿噴,謝謝
請幫忙解釋一道關(guān)于this的面試題?
犯罪嫌疑人X
2018-09-24 20:03:40