应该是指向undefined吧?
The value of this provided for the call to fun. Note that this may not be the actual value seen by the method: if the method is a function in non-strict mode code, null and undefined will be replaced with the global object and primitive values will be converted to objects.
摘自MDN,已经解释得很清楚了。和theWalker说的一致
10 回答11.3k 阅读
5 回答4.9k 阅读✓ 已解决
4 回答3.2k 阅读✓ 已解决
2 回答2.8k 阅读✓ 已解决
3 回答2.4k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
不对,如果在浏览器是指向
window
, Node中是global
。注意:当第一个参数为
null
或undefined
时,将是JS执行环境的全局变量。浏览器中是window,其它环境(如node)则是global。