New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Day18:写出执行结果,并解释原因 #54
Comments
答案 解析 |
答案 |
reduce: () => this.a -2; 这行代码最后一行的 |
我本来以为严格模式下 this 不能指向全局对象,没想到箭头函数是可以的。 function f(){
console.log(this);
}
f();// undefined
const f2 = () => {
console.log(this);
}
f2();// window |
测试为-1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
扫描下方二维码,收藏关注,及时获取答案以及详细解析,同时可解锁800+道前端面试题。
The text was updated successfully, but these errors were encountered: