var name = '南玖';
var person = {
name: 'nanjiu',
say: function() {
console.log('say:', this.name);
},
say2: () => {
console.log('say2:', this.name);
}
}
person.say();//say: nanjiu
person.say2();// say: '南玖'
结论:
箭头函数的this就是定义的时候就确定
普通的就看调用
标签:say2,person,say,name,箭头,普通,函数 From: https://www.cnblogs.com/Ly021/p/17779452.html