What’s New in JavaScript (ES2026) Cheat Sheet
This page condenses the finished JavaScript features in ES2026, plus a recap of ES2025, into one scannable reference. You can also download the information as a printable cheat sheet:
Free Bonus: What's New in JavaScript (ES2026) Cheat Sheet
Get the What's New in JavaScript (ES2026) Cheat Sheet (PDF), a printable reference to Map upsert, JSON.parse source text, Iterator.concat, Array.fromAsync, Base64 and hex bytes, Error.isError, and an ES2025 recap:
Want a guided path instead of a reference? Start learning at realjs.com.
Upgrading
- ES2026 covers proposals finished (Stage 4) for the 2026 spec
- Check engines before you ship: Node, browsers
- Temporal and
usingare Stage 4 but land in ES2027
Run the Latest Node.js
$ node --version
v26.13.0
$ npx node@26 script.mjs
Test for a Feature
typeof Math.sumPrecise; // "undefined"
typeof Iterator.concat; // "function"
Map Upsert
getOrInsertreplaces thehas,set,getdancegetOrInsertComputedruns the callback only if the key is missingWeakMaphas both methods too
Insert a Default Once
const groups = new Map();
groups.getOrInsert("a", []).push(1);
groups.getOrInsert("a", []).push(2);
groups; // Map(1) { 'a' => [ 1, 2 ] }
Compute a Default Lazily
const m = new Map();
m.getOrInsertComputed("b", (k) => k + "!");
m; // Map(1) { 'b' => 'b!' }
Iterator.concat
- Chains iterables lazily into one iterator
Join Iterables
Iterator.concat([1, 2], new Set([3]))
.map((n) => n * 2)
.toArray(); // [ 2, 4, 6 ]
JSON.parse Source Text
Keep Big Integers Exact
JSON.parse(
'{"id":12345678901234567890}',
(key, val, { source }) =>
typeof val === "number"
? BigInt(source)
: val,
);
// { id: 12345678901234567890n }
Write a Number Verbatim
JSON.stringify({
n: JSON.rawJSON("12345678901234567890"),
});
// '{"n":12345678901234567890}'
Free Bonus: Download the What’s New in JavaScript (ES2026) Cheat Sheet PDF and keep the essentials at hand.
Array.fromAsync
Collect an Async Iterable
async function* gen() {
yield 1;
yield 2;
}
await Array.fromAsync(gen());
// [ 1, 2 ]
Await Promises and Map Them
await Array.fromAsync(
[Promise.resolve(1), 2],
(n) => n * 2,
); // [ 2, 4 ]
Base64 and Hex Bytes
- No more
btoaandBufferworkarounds - Works on any
Uint8Array, in browsers too
Encode and Decode
const bytes = new Uint8Array([72, 105]);
bytes.toBase64(); // "SGk="
bytes.toHex(); // "4869"
Uint8Array.fromBase64("SGk=");
// Uint8Array(2) [ 72, 105 ]
Uint8Array.fromHex("ff00");
// Uint8Array(2) [ 255, 0 ]
URL-Safe Base64
new Uint8Array([251, 255]).toBase64({
alphabet: "base64url",
}); // "-_8="
Error.isError
Check Errors Reliably
Error.isError(new TypeError("x")); // true
Error.isError({ message: "x" }); // false
Math.sumPrecise
Not in Node 26 Yet
// Stage 4 for ES2026, but Node 26 lacks it
typeof Math.sumPrecise; // "undefined"
// Once shipped: exact, no drift
// Math.sumPrecise([0.1, 0.2, 0.3])
Free Bonus: Download the What’s New in JavaScript (ES2026) Cheat Sheet PDF and keep the essentials at hand.
ES2025 Recap: Iterators and Sets
Iterator Helpers
[1, 2, 3, 4].values()
.filter((n) => n % 2)
.map((n) => n * 10)
.take(2)
.toArray(); // [ 10, 30 ]
Set Methods
const a = new Set([1, 2, 3]);
const b = new Set([2, 3, 4]);
a.union(b); // Set(4) { 1, 2, 3, 4 }
a.intersection(b); // Set(2) { 2, 3 }
a.difference(b); // Set(1) { 1 }
a.isSubsetOf(b); // false
ES2025 Recap: Promises and Modules
Promise.try
Promise.try(() => {
throw new Error("x");
}).catch((e) => e.message);
// Promise resolves to "x"
JSON Modules
import data from "./d.json"
with { type: "json" };
data; // { a: 1 }
ES2025 Recap: Numbers
Float16 Typed Arrays
new Float16Array([1.337])[0];
// 1.3369140625
Math.f16round(1.337);
// 1.3369140625
ES2025 Recap: Regular Expressions
RegExp.escape
RegExp.escape("a.b*c"); // "\\x61\\.b\\*c"
Inline Modifiers
/(?i:a)b/.test("Ab"); // true
/(?i:a)b/.test("AB"); // false
Duplicate Named Groups
const re =
/(?<y>\d{4})-\d\d|\d\d-(?<y>\d{4})/;
"2026-10".match(re).groups.y; // "2026"
"10-2026".match(re).groups.y; // "2026"
Want to go deeper on modern JavaScript?
RealJS teaches the mental models that let you write, read, and review modern JavaScript with confidence, whether you or an AI wrote it.
Learn more at realjs.com 💡
You can download this information as a printable cheat sheet:
Free Bonus: What's New in JavaScript (ES2026) Cheat Sheet
Get the What's New in JavaScript (ES2026) Cheat Sheet (PDF), a printable reference to Map upsert, JSON.parse source text, Iterator.concat, Array.fromAsync, Base64 and hex bytes, Error.isError, and an ES2025 recap: