Skip to main content

ECMAScript Versions

Quick-reference of notable features added in each ECMAScript edition from ES2015 to ES2026. Listed newest-first. Based on Paweล‚ Grzybek's annual ECMAScript roundup.

ES2026โ€‹

FeatureDescriptionLink
Array.fromAsyncCreates an array from an async iterableMDN
Error.isErrorSafe cross-realm error detectionMDN
Math.sumPreciseSums an iterable with better floating-point precisionMDN
Uint8Array Base64/hexBuilt-in toBase64(), toHex(), fromBase64(), fromHex()MDN
Iterator.concatConcatenate multiple iterators into oneMDN
JSON.parse source text accessReviver gets raw source string; JSON.rawJSON() for lossless BigIntsMDN
Map.prototype.getOrInsertInsert-if-absent pattern built into MapMDN
const arr = await Array.fromAsync(asyncGenerator());
const cache = new Map();
const value = cache.getOrInsertComputed("key", () => expensiveCompute());

ES2025โ€‹

FeatureDescriptionLink
Set methodsintersection, union, difference, symmetricDifference, isSubsetOf, isSupersetOf, isDisjointFromMDN
Iterator Helpersmap, filter, take, drop, flatMap, reduce, toArray on iteratorsMDN
Promise.tryWraps sync or async functions into a Promise chainMDN
Import Attributesimport x from "./f.json" with { type: "json" }MDN
Float16ArrayHalf-precision 16-bit float typed arrayMDN
RegExp.escapeEscapes a string for safe use inside a RegExpMDN
Duplicate named capture groupsSame (?<name>...) allowed in different regex alternativesMDN
RegExp pattern modifiersApply flags like (?i:...) to a sub-expression onlyMDN
const a = new Set([1, 2, 3]);
const b = new Set([2, 3, 4]);
a.intersection(b); // Set {2, 3}
const evens = Iterator.from([1, 2, 3, 4, 5])
.filter(n => n % 2 === 0)
.toArray(); // [2, 4]
import data from "./config.json" with { type: "json" };

ES2024โ€‹

FeatureDescriptionLink
Object.groupBy / Map.groupByGroup array elements by a callbackMDN
Promise.withResolversReturns { promise, resolve, reject } for deferred promisesMDN
Well-Formed Unicode StringsisWellFormed() and toWellFormed() on stringsMDN
Atomics.waitAsyncAsynchronous atomic wait, usable on the main threadMDN
RegExp v flagUnicode set notation with -- subtraction and && intersectionMDN
Resizable ArrayBufferArrayBuffer with maxByteLength and resize()MDN
ArrayBuffer transfertransfer() and transferToFixedLength()MDN
const grouped = Object.groupBy(items, item => item.category);
const { promise, resolve, reject } = Promise.withResolvers();

ES2023โ€‹

FeatureDescriptionLink
Change Array by CopytoReversed(), toSorted(), toSpliced(), with() โ€” immutable operationsMDN
findLast / findLastIndexSearch from the end of an arrayMDN
Hashbang Grammar#!/usr/bin/env node recognized by the parserMDN
Symbols as WeakMap keysNon-registered Symbols can be WeakMap/WeakSet keysMDN
const sorted = arr.toSorted((a, b) => a - b); // original unchanged
const updated = arr.with(2, "new value");

ES2022โ€‹

FeatureDescriptionLink
Class fields & private methodsPublic/static/#private fields and methodsMDN
Top-level awaitUse await at module top levelMDN
.at() methodRelative indexing with negative indicesMDN
Object.hasOwnSafer replacement for hasOwnPropertyMDN
Error causenew Error("msg", { cause }) for chained errorsMDN
RegExp Match Indices (d flag)exec() results include .indicesMDN
Class static {} blocksStatic initialization logic in class bodyMDN
const last = arr.at(-1);
class Counter {
#count = 0;
increment() { this.#count++; }
}

ES2021โ€‹

FeatureDescriptionLink
String.prototype.replaceAllReplace all occurrences without regexMDN
Promise.anyResolves with first fulfilled; rejects with AggregateErrorMDN
Logical assignment (&&=, ||=, ??=)Combine logical operators with assignmentMDN
Numeric separators1_000_000 for readable numbersMDN
WeakRef & FinalizationRegistryWeak references and GC callbacksMDN
const text = "aabbcc".replaceAll("b", "x"); // "aaxxcc"
user.name ??= "Anonymous";

ES2020โ€‹

FeatureDescriptionLink
Optional chaining (?.)Safe property access through nullable chainsMDN
Nullish coalescing (??)Default only for null/undefined, not falsyMDN
BigIntArbitrary-precision integers (123n)MDN
Promise.allSettledWaits for all promises regardless of outcomeMDN
globalThisUniversal global object across environmentsMDN
Dynamic import()On-demand module loadingMDN
String.prototype.matchAllIterator of all regex matches with groupsMDN
import.metaHost-specific module metadataMDN
const name = user?.profile?.name ?? "Anonymous";
const module = await import("./feature.js");

ES2019โ€‹

FeatureDescriptionLink
Array.prototype.flat / flatMapFlatten nested arrays; map then flattenMDN
Object.fromEntriesCreate object from key-value pairsMDN
String.prototype.trimStart/trimEndTrim whitespace from one endMDN
Optional catch bindingcatch {} without parameterMDN
Symbol.prototype.descriptionDirect access to Symbol's descriptionMDN
Stable Array.prototype.sortSort guaranteed to be stableMDN
const flat = [[1, 2], [3, 4]].flat(); // [1, 2, 3, 4]
const obj = Object.fromEntries(new URLSearchParams("a=1&b=2"));

ES2018โ€‹

FeatureDescriptionLink
Object rest/spread ({...obj})Spread properties for objectsMDN
Async iteration (for await...of)Iterate over async iterablesMDN
Promise.prototype.finallyCallback after promise settlesMDN
RegExp named capture groups(?<name>...) syntaxMDN
RegExp s (dotAll) flag. matches line terminatorsMDN
RegExp lookbehind assertions(?<=...) and (?<!...)MDN
RegExp Unicode property escapes\p{Script=Greek} with u flagMDN
const { a, ...rest } = { a: 1, b: 2, c: 3 }; // rest = { b: 2, c: 3 }
for await (const chunk of readableStream) {
process(chunk);
}

ES2017โ€‹

FeatureDescriptionLink
async / awaitSyntactic sugar for promise-based async codeMDN
Object.values / Object.entriesGet own enumerable values or [key, value] pairsMDN
String.prototype.padStart/padEndPad string to target lengthMDN
Object.getOwnPropertyDescriptorsAll own property descriptors for proper cloningMDN
SharedArrayBuffer & AtomicsShared memory for multi-threaded JSMDN
Trailing commas in function paramsAllowed in parameter lists and argumentsMDN
async function fetchData() {
const response = await fetch(url);
return response.json();
}

ES2016โ€‹

FeatureDescriptionLink
Array.prototype.includesCheck if array contains element (handles NaN)MDN
Exponentiation operator (**)2 ** 4 instead of Math.pow(2, 4)MDN
[1, 2, NaN].includes(NaN); // true
2 ** 10; // 1024

ES2015 (ES6)โ€‹

Syntaxโ€‹

FeatureDescriptionLink
let and constBlock-scoped variable declarationsMDN
Arrow functions() => {} with lexical thisMDN
Template literals`Hello ${name}` โ€” interpolation and multilineMDN
DestructuringExtract values from arrays/objectsMDN
Default parametersfunction f(x = 1)MDN
Rest/spread (...)Rest params and array spreadMDN
Classesclass / extends / superMDN
Generators (function*)Pausable functions yielding valuesMDN

Built-insโ€‹

FeatureDescriptionLink
PromisesBuilt-in async primitivesMDN
SymbolNew primitive for unique identifiersMDN
Map / SetNew collection typesMDN
WeakMap / WeakSetGC-friendly collectionsMDN
Proxy / ReflectMeta-programming via trapsMDN
Iterators & for...ofIteration protocol and loopMDN
Typed ArraysArrayBuffer, DataView, typed viewsMDN
Object.assignShallow-copy/merge objectsMDN
Array.from / Array.ofCreate arrays from iterables or argumentsMDN
String methodsincludes, startsWith, endsWith, repeatMDN
Number methodsisFinite, isNaN, isInteger, isSafeIntegerMDN

Modulesโ€‹

FeatureDescriptionLink
import / exportNative ES module systemMDN
const [first, ...rest] = [1, 2, 3, 4];
const greet = (name = "world") => `Hello, ${name}!`;
class Animal {
constructor(name) { this.name = name; }
speak() { return `${this.name} makes a noise.`; }
}

Further Readingโ€‹