5 Answers
5

All browsers that are used today support a common javascript

Javascript is defined by the ECMA-262 standard, either version 3, or version 5. Both versions have the same syntax -- the new things in version 5 are all backwards compatible.

All browsers support the version 3 syntax and objects. Internet Explorer has some brokenness, but supports all the basic syntax and semantics. Firefox has some extensions to the language, but those are disabled on web pages, and are only available for extensions.

The last piece of missing syntax that was seen in a browser was in IE 4.0, which did not have try/catch/finally. That arrived in IE 5.0.

The biggest syntax danger you can still run into today is that IE improperly processes trailing commas in array and object literals. Make sure you don't have any of those, and you can write cross-browser javascript just fine.

I don't know about non-browser environments. Except Flash, where actionscript is based on an abandoned version that never became a standard (ES4).
–
Sean McMillanSep 30 '11 at 21:07

Yeah MainMa's answer somehow suggests this too, printed myself a copy of the 262 standard and all. All the DOM stuff is missing though, obviously. It's great to know that the version 5 retrofits. Thank you.
–
vemvOct 2 '11 at 12:32

Different browsers support different versions of JavaScript, and different versions of JavaScript have changes in their syntax. So no, the syntax is not the same, except if you stick with the version old enough to be supported in most browsers.

For example, you can see some cool syntax which, for some, is available in JavaScript 1.8, released in June 2008 and incompatible with FF2 and, as usual, all releases of IE except 9.

The current JavaScript version is 1.8.5. JavaScript has evolved over many stages. So different browsers not only differ in their DOM models, but also in syntax. An overview for browsers is given in Wikipedia. So you should be careful when using advanced features.