JavaScript was created by Brendan Eich at Netscape and first appeared in Navigator 2.0. The language is standardised as ECMAScript, in the standard ECMA-262, maintained by the committee TC39 at Ecma International. A source file carries no marker of the edition it was written for: a program uses whatever features the engine running it supports.
Editions
Since 2015, an edition has been published each year and named after that year. The sixth edition is known both as ES6 and as ES2015.
| Name | Edition | Adopted | Headline features |
|---|---|---|---|
| ES1 | 1st | June 1997 | The first standard |
| ES2 | 2nd | June 1998 | Editorial, to match ISO/IEC 16262 |
| ES3 | 3rd | December 1999 | Regular expressions, try/catch, switch |
| ES4 | 4th | Never published | Abandoned |
| ES5 | 5th | December 2009 | Strict mode, accessors, JSON |
| ES5.1 | 5.1 | June 2011 | Minor corrections |
| ES2015 | 6th | June 2015 | Classes, modules, let, arrows, promises, generators |
| ES2016 | 7th | June 2016 | **, includes |
| ES2017 | 8th | June 2017 | Async functions, shared memory |
| ES2018 | 9th | June 2018 | Async iteration, object spread |
| ES2019 | 10th | June 2019 | flat, optional catch binding |
| ES2020 | 11th | June 2020 | BigInt, ?., ??, import() |
| ES2021 | 12th | June 2021 | Logical assignment, WeakRef |
| ES2022 | 13th | June 2022 | Class fields, private names, top-level await |
| ES2023 | 14th | June 2023 | Hashbang, array copy methods |
| ES2024 | 15th | June 2024 | v flag, groupBy |
| ES2025 | 16th | June 2025 | Iterator helpers, Set methods, import attributes |
| ES2026 | 17th | June 2026 | Math.sumPrecise, Map upsert, base64 |
| ES2027 | 18th | Draft | using, Iterator additions |
How features are added
Proposals move through the numbered stages of the TC39 process, and a proposal that reaches stage 4 is written into the next edition. Engines often ship a feature before the edition that contains it is published.
ES1 (June 1997)
The first edition standardised the language as implemented in browsers of the time:
types and objects with prototypes, functions, var, the
if, while, for, for…in,
with and return statements, and the core objects
Object, Function, Array, String,
Boolean, Number, Math and Date.
ES2 (June 1998)
An editorial revision to keep the standard aligned with ISO/IEC 16262, approved in April 1998. The language did not change.
ES3 (December 1999)
- Regular expressions, with
RegExpand the string methods that use them. - New control statements:
do-while,switchand labels. try,catch,finallyandthrow, with the standardErrortypes.- Object and array literals, and function expressions.
===,!==,inandinstanceof.- Numeric formatting:
toFixed,toExponentialandtoPrecision. - Array methods such as
push,popandsplice, and the URI functions.
ES4 (abandoned)
Work on a fourth edition was never completed or published. Some of its ideas went into the sixth edition.
ES5 and ES5.1 (December 2009, June 2011)
- Strict mode.
- Accessor
properties and property attributes, with
Object.defineProperty. - Reflective creation and inspection:
Object.create,Object.keys,Object.getPrototypeOf,Object.freezeand others. - Array methods:
forEach,map,filter,reduce,indexOfand others. - The
JSONobject. Function.prototype.bind,String.prototype.trim,Date.nowand thedebuggerstatement.- Reserved words as property names, and trailing commas in object literals.
Edition 5.1 made minor corrections, and is the same text as ISO/IEC 16262:2011.
ES2015 (June 2015)
The sixth edition was the largest update to the language.
let,constand block scope.- Arrow functions, default and rest parameters, spread, destructuring.
class, includingextendsandsuper.- Modules, with
importandexport. - Iterators,
for…ofand generators. - Template literals, shorthand and computed object keys, binary and octal
literals,
\u{…}escapes. Symbol,Map,Set,WeakMap,WeakSet,Promise,ProxyandReflect.- Typed arrays,
ArrayBufferandDataView. uandyregular expression flags.- Tail calls.
ES2016
- The exponentiation operator
**. Array.prototype.includes.
ES2017
- Async functions and
await. SharedArrayBuffer,Atomicsand the memory model.Object.values,Object.entriesandObject.getOwnPropertyDescriptors.padStart,padEnd, and trailing commas in parameter and argument lists.
ES2018
- Async iteration:
for awaitand async generators. - Rest and spread for object properties.
Promise.prototype.finally.- Regular expressions: the
sflag, named groups, Unicode property escapes and lookbehind. - Tagged templates may contain invalid escapes.
ES2019
flat,flatMap,Object.fromEntries,trimStart,trimEndandSymbol.prototype.description.- Optional
catchbinding. - U+2028 and U+2029 allowed in string literals, so JSON is a subset of the language.
Array.prototype.sortmust be stable, andJSON.stringifymust return well-formed text.Function.prototype.toStringrevised to return source text.
ES2020
BigInt.- Optional chaining
?.and nullish coalescing??. import(),import.metaandexport * as ns from.globalThis,matchAllandPromise.allSettled.- A more fully specified
for…inorder.
ES2021
- Logical assignment:
&&=,||=and??=. - Numeric separators.
replaceAll,Promise.anyandAggregateError.WeakRefandFinalizationRegistry.
ES2022
- Top-level
awaitin modules. - Public and private fields, private methods and accessors, static blocks, and
#x in obj. - The
dflag for match indices. causeon errors,at, andObject.hasOwn.
ES2023
toSorted,toReversed,with,findLast,findLastIndexandtoSpliced.- Hashbang comments.
- Most symbols allowed as keys in weak collections.
ES2024
- Resizable and transferable
ArrayBuffer, and growableSharedArrayBuffer. - The
vregular expression flag. Promise.withResolvers,Object.groupByandMap.groupBy.Atomics.waitAsync,isWellFormedandtoWellFormed.
ES2025
- The
Iteratorglobal and iterator helpers. - New
Setmethods. - Import attributes and JSON modules.
RegExp.escape, modifier groups and duplicate named groups.Promise.try.Float16Array,Math.f16round, and theDataViewmethods for it.
ES2026
Math.sumPrecise.Iterator.concatandArray.fromAsync.Error.isError.getOrInsertandgetOrInsertComputedonMapandWeakMap.Uint8Arrayconversion to and from base64 and hex.- Source text access in
JSON.parserevivers, andJSON.rawJSON.
The current draft (ES2027)
The draft at tc39.es/ecma262 is the eighteenth edition. It already includes these proposals, which have finished the process:
usingandawait using, withSymbol.dispose,Symbol.asyncDispose,DisposableStack,AsyncDisposableStackandSuppressedError.- Iterator additions:
Iterator.zip,Iterator.zipKeyed,chunks,windows,includesandjoin. Atomics.pause.
Temporal has also finished the process, with ES2027 as its expected
edition, but was not in the text of the draft at the time of writing.
Compatibility between editions
New editions are designed not to break existing code on the web. Annexes E and F of ECMA-262 list the few changes that have an observable effect on older programs. Features kept only for old pages are in Annex B.