1.箭头函数的定时器this指向当前对象
var obj ={
name:"Tina",
popup:function(){
setTimeout(()=>{
console.log("打印名字",this.name)
},3000)
}
}
obj.popup();
//打印名字 Tina
2.普通函数定时器this指向windows
var obj ={
name:"sonia",
popup:function(){
setTimeout(function(){
console.log("打印名字",this.name)
},3000)
}
}
obj.popup();
//打印名字
3.