定义时所处的对象就是它的this
看外层是否有函数
若是有,外层函数的this就是内部箭头函数的this
若是没有,this就是window
let obj = { name : '箭头函数', getName : () => { setTimeout(() => { // 这里this指向window // 能够理解成下面这种形式 console.log(this); }, 10); } }; // 指向window的缘由 // obj.getName = () => { // console.log(this); // setTimeout(() => { // console.log(this); // }, 10); // } // obj.getName();