JS 中 this 的绑定规则与箭头函数差异
阅读代码并说明各处 this 指向:const obj={name:‘o’,fn(){ console.log(this.name); const inner=()=>console.log(this.name); const normal=function(){console.log(this.name)}; inner(); normal(); setTimeout(()=>console.log(this.name),0) }}; obj.fn(); 再问:obj.fn.call({name:‘x’}) 时箭头函数里的 this 是否变化?总结 this 绑定优先级,并说明 class 方法 this 丢失的常见场景与修复方式。