简体   繁体   English

我应该使用哪个ECMA-262(ECMAScript / JavaScript)参考?

[英]Which ECMA-262 (ECMAScript/JavaScript) reference should I use?

The more I read JavaScript Q&A, the more I come across references to the ECMA-262 我读的JavaScript问答越多,我就会越多地提到ECMA-262 sleeping medication 睡眠用药 reference. 参考。 I've seen some as HTML in addition to the official pdf . 除了官方的pdf之外,我还看到了一些HTML

I'd like to link to the HTML references, but I'm hesitant because I don't have the time to verify their authenticity, accuracy or consistency. 我想链接到HTML引用,但我很犹豫,因为我没有时间来验证它们的真实性,准确性或一致性。

Is there a particular ECMAScript reference other than the PDF that is trusted, or generally endorsed by the Stack Overflow community? 是否存在特定的ECMAScript引用不是受信任的PDF,或者通常由Stack Overflow社区认可?

The current version of the ECMAScript documentation is only available as a PDF download. ECMAScript文档的当前版本仅作为PDF下载提供。 The previous version did have an experimental HTML version but that was a converted version from PDF->HTML which contained a few errors. 之前的版本确实有一个实验性HTML版本,但这是PDF-> HTML的转换版本,其中包含一些错误。 I think they decided to discontinue the HTML versions because of those errors. 我认为他们决定因为这些错误而停止使用HTML版本。

In general it's okay to link to the HTML version here on SO, even although it's an outdated spec. 一般情况下,可以在SO上链接到HTML版本,即使它是一个过时的规范。 Do always check whether something has changed in that section though - don't link to sections that have changed since the last version, to avoid confusion between the previous and latest versions. 请始终检查该部分中是否有更改 - 请勿链接到自上一版本以来已更改的部分,以避免先前版本和最新版本之间出现混淆。 Of course, it's always best to simply link to the PDF itself. 当然,最好只链接到PDF本身。

If you need a linkable reference, the Mozilla Developer Network is usually a good option. 如果您需要可链接的参考, Mozilla开发者网络通常是一个不错的选择。 It doesn't contain the exact text of ECMA-262, but that may very well be a good thing (think laymen). 它不包含ECMA-262的确切文本,但这可能是一件好事(想想非专业人士)。

Plus, considering Mozilla is an active browser vendor, I'd say their desire and incentive to "get it right" is probably about as great as it gets. 另外,考虑到Mozilla是一个活跃的浏览器供应商,我会说他们“做到正确”的愿望和动力可能与它一样大。

And they document well. 他们记录得很好。 If there are any possible issues with availability of a feature (whether deprecated or a newer addition), you'll generally find a description of compatibility for other (top) browsers along with "shim" code within the description when available. 如果功能的可用性存在任何可能的问题(无论是弃用还是新添加),您通常会在可用时找到其他(顶部)浏览器的兼容性描述以及描述中的“填充”代码。 The ES5-shim even seems to be largely made up of MDN's "Compatibility" code. ES5-Shim甚至似乎主要由MDN的“兼容性”代码组成。

Ecma International published ECMAScript 5.1 both as an Acrobat (r) PDF file and as Browsable HTML: Ecma International将ECMAScript 5.1作为Acrobat(r)PDF文件和可浏览HTML发布:

The second option may be more official than the "annotated, hyperlinked, HTML version" you mentioned. 第二个选项可能比您提到的“带注释,超链接,HTML版本”更正式。

However, note that 但请注意

The PDF version is the definitive specification. PDF版本是权威规范。 Any discrepancies between this HTML version and the PDF version are unintentional. 此HTML版本与PDF版本之间的任何差异都是无意的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM