RiderKick
Results
1
comments of
RiderKick
山月老师,应该是“**只有在存在 this 的函数前设置严格模式**,this为undefined。”才对。 ``` "use strict"; function foo() { console.log( this.a ); } var a = 2; (function(){ foo(); })(); ``` 按以上代码执行,函数`foo`中的`this`就不能指向`window`了。 不应该只是在函数中,在函数前设置*严格模式*,`this`为`undefined`