直接上代码:
var test = { outer: function () { // 此时this指向test对象 console.log(this); function inner() { // 此时this指向window console.log(this); } inner(); } }
造成上述代码this指向不同的原因是什么呢?
到现在都是很明白,求大神解答!
眼眸繁星
相关分类