简体   繁体   中英

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 sleeping medication reference. I've seen some as HTML in addition to the official pdf .

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.

Is there a particular ECMAScript reference other than the PDF that is trusted, or generally endorsed by the Stack Overflow community?

The current version of the ECMAScript documentation is only available as a PDF download. The previous version did have an experimental HTML version but that was a converted version from PDF->HTML which contained a few errors. I think they decided to discontinue the HTML versions because of those errors.

In general it's okay to link to the HTML version here on SO, even although it's an outdated spec. 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.

If you need a linkable reference, the Mozilla Developer Network is usually a good option. It doesn't contain the exact text of ECMA-262, but that may very well be a good thing (think laymen).

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.

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.

Ecma International published ECMAScript 5.1 both as an Acrobat (r) PDF file and as Browsable HTML:

The second option may be more official than the "annotated, hyperlinked, HTML version" you mentioned.

However, note that

The PDF version is the definitive specification. Any discrepancies between this HTML version and the PDF version are unintentional.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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