Tag: 使用严格

为什么在使用strict时,“this”在匿名函数中是undefined?

为什么在严格模式下使用JavaScript时, 这是一个匿名函数undefined? 我明白为什么这可能是有道理的,但我找不到具体的答案。 例: (function () { "use strict"; this.foo = "bar"; // *this* is undefined, why? }()); 在小提琴中testing: http : //jsfiddle.net/Pyr5g/1/检查logging器(萤火虫)。