应该是指向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说的一致
13 回答12.9k 阅读
7 回答2k 阅读
3 回答1.2k 阅读✓ 已解决
2 回答1.3k 阅读✓ 已解决
6 回答1.1k 阅读✓ 已解决
6 回答1k 阅读
2 回答1.3k 阅读✓ 已解决
不对,如果在浏览器是指向
window
, Node中是global
。注意:当第一个参数为
null
或undefined
时,将是JS执行环境的全局变量。浏览器中是window,其它环境(如node)则是global。