ECMAScript is a JavaScript standard developed by Ecma International. Since 2015, major versions have been published every June. ECMAScript 2025, the 16th and current version, was released in June 2025.
Versions
In June 2004, Ecma International published ECMA-357 standard, defining an extension to ECMAScript, known as ECMAScript for XML (E4X). Ecma also defined a "Compact Profile" for ECMAScript – known as ES-CP, or ECMA 327 – that was designed for resource-constrained devices, which was withdrawn in 2015.
4th edition (abandoned) The proposed 4th edition of ECMA-262 (ECMAScript 4 or ES4) would have been the first major update to ECMAScript since the 3rd edition was published in 1999. The specification (along with a reference implementation) was originally targeted for completion by October 2008. The first draft was dated February 1999. An overview of the language was released by the working group on 23 October 2007. By August 2008, the ECMAScript 4th edition proposal had been scaled back into a project code named ECMAScript Harmony. Features under discussion for Harmony at the time included:
classes, a module system, optional type annotations and static typing, probably using a structural type system, generators and iterators, destructuring assignment, and algebraic data types. The intent of these features was partly to better support programming in the large, and to allow sacrificing some of the script's ability to be dynamic to improve performance. For example, Tamarin – the virtual machine for ActionScript, developed and open-sourced by Adobe – has just-in-time compilation (JIT) support for certain classes of scripts. In addition to introducing new features, some ES3 bugs were proposed to be fixed in edition 4. These fixes and others, and support for JSON encoding/decoding, have been folded into the ECMAScript, 5th Edition specification. Work started on Edition 4 after the ES-CP (Compact Profile) specification was completed, and continued for approximately 18 months where slow progress was made balancing the theory of Netscape's JavaScript 2 specification with the implementation experience of Microsoft's JScript .NET. After some time, the focus shifted to the ECMAScript for XML (E4X) standard. The update has not been without controversy. In late 2007, a debate between Brendan Eich, later the Mozilla Foundation's CTO, and Chris Wilson, Microsoft's platform architect for Internet Explorer, became public on a number of blogs. Wilson cautioned that because the proposed changes to ECMAScript made it backwards incompatible in some respects to earlier versions of the language, the update amounted to "breaking the Web", and that stakeholders who opposed the changes were being "hidden from view". Eich responded by stating that Wilson seemed to be "repeating falsehoods in blogs" and denied that there was attempt to suppress dissent and challenged critics to give specific examples of incompatibility. He pointed out that Microsoft Silverlight and Adobe AIR rely on C# and ActionScript 3 respectively, both of which are larger and more complex than ECMAScript Edition 3. ECMAScript 4 introduces a strict typing system. For example, a function add() could look like the following:
The following primitive types were defined:
Variables could have the following modifiers:
static: makes a variable a class variable prototype: adds a variable to the class prototype object, with a get/set accessor Classes were given the following modifiers:
dynamic: allows properties to be added to instances at runtime final: cannot be extended by other classes internal: visible only to references in the current package public: visible to references globally Class constructors were declared with the function keyword (rather than constructor), and took the name of the class itself:
Getter and setter methods were also defined with the get and set keywords:
Functions could have the following modifiers:
static: makes the function a trait of the class, rather than an instance (i.e. a static method) final: declares a function cannot be overriden override: overrides a method of the same name and signature native: declares a function to be "implementation-defined" Interfaces were introduced, which, much like Java interfaces, define a contract between an instance and code that consumes it.
ECMAScript 4 additionally introduced packages, which acted like packages in Java or namespaces in C++ and C#. In addition, an "unnamed package" basically acted as the global namespace, which was implicitly imported by all other packages (and given by package { /* ... */ }).
In this example, Article has a fully-qualified name of org.wikipedia.Article. While modern ECMAScript features modules, ECMAScript 4 packages behaved more like a global naming scheme, akin to those of Java. Namespaces also existed as a separate feature from packages, and acted as a qualifier of the definition's name.
… excerpt ends here. Continue reading the full article.