前端面试题--技术无忧(tech51.cn)
name = 'tom'
const obj = {
    name: 'zc',
    intro: () => {
        console.log('My name is ' + this.name);
    }
}
obj.intro();

解析: 箭头函数没有this绑定,但它可以通过作用域链查到外层作用域的this。intro函数的上层作用域为window。

答案: My name is tom

编号: 136