JavaScript (ECMAScript 5) 教程

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6949736/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 22:27:24  来源:igfitidea点击:

JavaScript (ECMAScript 5) Tutorial

javascriptecmascript-5

提问by apokaliptis

I hear that ECMAScript 5 is now getting supported by most of the latest browsers. Are there any good tutorials out there? I tried looking myself but I didn't find anything. Is the ES5 documentation the only thing out there? I mainly want to know what has been depreciated in the new standard. If I avoid these i can feel right at home when I move to ES5 and I wont miss anything depreciated.

我听说 ECMAScript 5 现在得到了大多数最新浏览器的支持。有什么好的教程吗?我试着寻找自己,但我什么也没找到。ES5 文档是唯一的东西吗?我主要想知道新标准中折旧了什么。如果我避免这些,当我转向 ES5 时,我会感到宾至如归,我不会错过任何折旧的东西。

采纳答案by Adam Golding

The new (2011) edition of "Javascript: The Definitive Guide" covers ECMAScript 5 functions thoroughly, and shows how to implement ECMAScript 3 equivalents in many cases :-)

新的(2011)版“Javascript:权威指南”彻底涵盖了 ECMAScript 5 函数,并展示了如何在许多情况下实现 ECMAScript 3 等效项:-)

回答by OnesimusUnbound

Referring to ECMAScript 5 compatibility tablepage, Firefox 4 - 6 and Chrome 13 - 14 are the most compatible browsers.

参考ECMAScript 5 兼容性表页面,Firefox 4 - 6 和 Chrome 13 - 14 是最兼容的浏览器。

The Mozilla JavaScript Referencemight be the closest. See its entryfor ECMAScript5 support for details.

Mozilla的JavaScript的参考可能是最接近的。有关详细信息,请参阅其ECMAScript5 支持条目

Update (2011-08-05)

更新 (2011-08-05)

It appears that ES5 is backward compatible with ES3 (1, 2). The only way to break the compatibility is to use "use strict" to enable a subset of ES5 deemed as less error prone.

ES5 似乎向后兼容 ES3 ( 1, 2)。打破兼容性的唯一方法是使用“use strict”来启用被认为不太容易出错的 ES5 子集。

回答by user4815162342

The features that have been deprecated are the features that are disabled when the "use strict" mode is initiated (a rather poor way of doing it, IMO, since it requires them to come up with new terminology for the next version... but I digress).

已弃用的功能是在启动“使用严格”模式时禁用的功能(IMO,这是一种相当糟糕的方式,因为它要求他们为下一个版本提出新术语......但是我离题了)。

I found Resig's article on this rather useful, although I haven't verified anything he says here: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/

我发现 Resig 在这方面的文章相当有用,尽管我还没有验证他在这里说的任何内容:http: //ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/