箭头函数体中的 this 对象,是定义函数时的对象,而不是使用函数时的对象。
var obj = {
name:"mumu",
age:18,
group:function(){
setInterval(()=>{
this.age++;
console.log(this.age);
},2000)
}
}
obj.group();
// 18
// 19
// ..