这是因为,在ECMAscript 262第5版之前,如果使用的人constructor pattern忘记使用该new关键字,那会造成很大的混乱。如果new在ES3中调用构造函数时忘了使用,请this引用全局对象(window在浏览器中),然后用变量破坏全局对象。这是可怕的行为等人在ECMA决定,只设置this到undefined。例:function myConstructor() { this.a = 'foo'; this.b = 'bar';}myInstance = new myConstructor(); // all cool, all fine. a and b were created in a new local objectmyBadInstance = myConstructor(); // oh my gosh, we just created a, and b on the window object最后一行会在严格的ES5中引发错误"TypeError: this is undefined"(这是一个更好的行为)