且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

null与undefined及其在JavaScript中的行为

更新时间:2023-11-29 08:55:10

短而甜的版本是那个JavaScript是由Netscape团队非常迅速地设计和实现的,它有一些不一致的地方,比如你已经指出的那些。

The short and sweet version is that JavaScript was designed and implemented very rapidly by the Netscape team, and it had some inconsistencies such as the ones that you've pointed out.

Internet Exploder团队做得***复制JS 正好,他们做得非常好,以至于不一致也被复制了。当Netscape将JS标准化时,因为ECMAScript MS是其中的一部分,并且基本上说他们不允许更改标准,因为它会破坏旧代码(现有系统惯性)。不一致是标准化的,就是这样。

The Internet Exploder team did its best to copy JS exactly and they did a damn good job of it to the point that the inconsistencies were copied as well. When Netscape went to get JS standardized as ECMAScript MS was a part of it and basically said that they weren't allowed to change the standard because it would break old code (existing systems inertia). The inconsistencies were standardized and that was that.

Douglas Crockford a关于其中一些问题的一系列非常好的讨论

Douglas Crockford has a very good series of talks about some of these issues.