Why is there no OFFICIAL JavaScript reference?
Solution 1
It's not like there is an official JavaScript release. All the browsers have made their own JavaScript engine - some are using the same though. But especially Internet Explorer has its own version that doesn't support a lot of what the other browsers support, making it very difficult to make a general JavaScript reference.
Edit:
While I know there is an official ECMA standard and development team, my point is that it doesn't really matter as long as browsers (Internet Explorer) doesn't live up to it. At the end of the day, clients want JavaScript to work for Internet Explorer too. They won't care about the ECMA standards, they just want it to work. This is where JavaScript libraries come into the picture, but that's another story.
It's the same issues with HTML and CSS, we can't use these tools for active development until:
- All browsers support them.
- We supply the browsers with code to make them support it.
- It's okay it doesn't work in all browsers.
Edit2:
Internet Explorer is getting close to the grave with the new browser project from Microsoft: Edge. This, however, doesn't really change the overall picture. We still have a lot if different browsers we need to support. Developers are constantly trying to push the boundaries of what's possible. This means that we often have this issue, some browser version we want to support doesn't support some feature of the standard (which usually is a bit fluid), which means we need to make some workaround or use frameworks that implement the missing built in features.
Solution 2
You can try with the official ECMAscript site,
but the useful thing is actually the implementation of each browser.
I like this cheatsheet from Danny Goodman's JavaScript Bible a lot:
http://media.wiley.com/product_ancillary/12/04705269/DOWNLOAD/9780470526910_Appendix_A.pdf
Solution 3
I would say this one is the "official": https://developer.mozilla.org/en/JavaScript
You also have the ECMAScript Language Specification, 5.1 Edition (or as a PDF, the definitive specification).
And from Microsoft: JavaScript Language Reference: "This documentation explains the Microsoft implementation of JavaScript, which is compliant with the ECMAScript 5th Edition language specification. It also provides additional features that are not included in the Ecma Standards."
Solution 4
Wikipedia's quotation:
Beginnings at Netscape
In November 1996, Netscape submitted JavaScript to Ecma International ...
JavaScript is officially managed by Mozilla Foundation ...
So, in my opinion, the ECMA is the standard and Mozilla is the official one.
Solution 5
It is very difficult to have an "official" reference as long as there are implementations (in all browsers) and there is a specification (ECMAScript) but no conformance tests of implementations against the specifications.
Now though, we have the EMCAScript 5 conformance suite at http://es5conform.codeplex.com/ - and there seems some consensus that ECMAScript implementations will come closer together, making ECMAScript more likely to be the official reference for the language.
huy
Cofounder at Holistics.io - BI tool for tech startups. Previously: Software Engineer at Viki. Built their data-warehousing infrastructure Growth Engineer Intern at Facebook HQ
Updated on July 08, 2022Comments
-
huy almost 2 years
I tried to search for a JavaScript reference, but there's none available. The best two suggested sources are MDN (Mozilla Developer Network) and ECMA (https://262.ecma-international.org/12.0/)
Why?
-
Quentin over 14 yearsIE doesn't have a JavaScript engine - it implements JScript instead (which is largely compatible). msdn.microsoft.com/en-us/library/yek4tbz0%28VS.85%29.aspx looks like the official reference for that.
-
huy over 14 yearsI see, so different browsers have its own implementation according to the ECMA-262 standard that Michael mentioned above?
-
Steve Harrison over 14 yearsHmm... developer.mozilla is very helpful, but I wouldn't call it "official". The ECMAScript Language Specification is closer to "official".
-
Andrzej Doyle over 14 years@huy: yes - with varying levels of support for/varying interpretations of that standard, sadly...
-
Quentin over 14 yearsThe ECMAScript Language Specification is the official reference for ECMAScript. JavaScript is a superset of ECMAScript, was created by Netscape, and Mozilla inherited MDC from Netscape (although the name has changed since then)
-
hasen over 14 years-1, There is an official Javascript standard: it's called ECMAscript and there's an official body behind it: en.wikipedia.org/wiki/Ecma_International
-
Jason S over 14 years+1 for the ECMAScript standard.
-
Admin almost 14 yearsI'm not sure why you singled out Internet Explorer as being any worse at supporting the ECMA "standard" as any other browser.
-
Pauan almost 13 yearsActually, the people responsible for JavaScript would be Netscape (now Mozilla), and they do make good documentation: the MDC. I agree with you about the ECMAScript standard being poor if you're trying to learn JavaScript, though.
-
Joe Dargie almost 13 years@Pauan: are Mozilla responsible for JavaScript? Isn’t it more like HTML and CSS, where browser manufacturers in general are collectively responsible for it? Or are Mozilla in reality the only organisation pushing the language (as opposed to DOM interfaces like those found in HTML5) forward? (I only ask as I’m not familiar with the situation; I have enough trouble getting my JavaScript code to work at all without worrying my pretty little head with new stuff in the core language.)
-
Pauan almost 13 yearsYes, they are. Sun owns the trademark for JavaScript, but licensed it to Netscape. Oracle bought Sun, so now Oracle owns the trademark (they still license it to Mozilla). HTML and CSS are defined by the W3C, so that's a different matter. The JS engine in Firefox contains many proprietary (and awesome) features that are not found in any other browser. The creator of JavaScript (Brendan Eich) is on the official ECMAScript committee, and also works for Mozilla.
-
Pauan almost 13 yearsIn addition, notice this link: en.wikipedia.org/wiki/ECMAScript#Dialects Firefox has what is known as "JavaScript 1.8.5" which as already mentioned contains many advanced features not found in other browsers like object/array destructuring/comprehensions, generators/iterators, let blocks/statements, etc. Also note the 2nd footnote in that link, which says "Mozilla manages the official version of JavaScript. Most non-Mozilla implementations claiming JavaScript "compliance" do not actually support most JavaScript extensions; rather, they target ECMA-262, edition 3."
-
Pauan almost 13 yearsI'll note that ECMAScript is different from JavaScript. ECMAScript is a standard defined by Ecma. Browsers are usually pretty good about supporting the ECMAScript standard, and when most people say "JavaScript" what they really mean is ECMAScript. It's unfortunate that the situation and terminology is so confusing, but there it is. So, for the most part, the informal definition of JavaScript is "whatever the browsers do", but officially, Mozilla is indeed responsible for it.
-
Pauan almost 13 yearsWhat this means is that any question that asks for an "official JavaScript reference" is far too vague to accurately answer. You have the official ECMAScript standard, the actual implementations of JavaScript in the browsers, the MDC (which covers the official JavaScript implementation in Firefox), and then of course the very popular unofficial documentation like w3schools. All are useful, so there's not really any "single correct" reference like there is for, say, Python.
-
Pauan almost 13 years(perhaps I should have posted this as an actual answer, rather than a series of comments... oh well)
-
Pauan almost 13 years@ראובן: Because it is/was. For a long time IE not only had many severe bugs that other browsers did not, but it also was missing important features that other browsers had. IE8 and 9 have caught up a lot, though, so the situation is changing. But for many years IE was horrid, while the other browsers had good ECMAScript support. In addition, ECMAScript is a standard. I'm not sure why you put it in quotation marks.
-
Joe Dargie almost 13 years@Pauan: heh! Quite possibly, it’s most deserving of upvotes.
-
Grinn almost 11 yearsThat cheat sheet is dead. Might I suggest caniuse.com?
-
Victor almost 11 yearsThanks, i linked to the new link and explained a bit what it was. Thanks for the heads up!
-
Grinn almost 11 yearsNice, I'll check that out.
-
DavidRR over 9 years@Quentin - Interesting that the title of the MSDN link you reference is now "JavaScript Reference". However, the MSDN article "JScript (ECMAScript3)" states: "JScript is the Microsoft implementation of the ECMA 262 language specification (ECMAScript Edition 3). With only a few minor exceptions (to maintain backwards compatibility), JScript is a full implementation of the ECMA standard.".
-
Quentin over 9 years@DavidRR — Microsoft have come a long way with standards support in the last half decade.
-
still_dreaming_1 over 7 yearsJust because browsers choose not to follow the standard does not mean an official reference would not be helpful. It would make it really clear when a browser decides to deviate from it, and would pressure them to consider such deviances as bugs that programmers will be very unhappy about. It would also provide developers with a starting point reference for when they want to make cross platform code so to speak.
-
Chafic over 6 yearsTo add to that answer, you can always find links to the current and past editions of the "ECMAScript Language Specification" on this page: developer.mozilla.org/en-US/docs/Web/JavaScript/….