JavaScript Tutorial 0/230 lessons ~6 min read Lesson 34

    JS 2026

    ECMAScript still ships a new edition every June.

    Course progress0%
    Focus
    9 guided sections
    Practice signal
    Examples included
    Career prep
    Interview Q&A included

    Introduction

    ECMAScript still ships a new edition every June. In 2026 the features you should actually use in production are the ones already in evergreen engines — especially Object.groupBy / Map.groupBy (ES2024) and iterator helpers (ES2025). Stage-3 work such as Temporal, decorators, and pattern matching still needs polyfills or flags; treat those as opt-in, not defaults.

    Why this feature exists

    What landed recently (and what is still Stage 3):

    • ES2024: Object.groupBy, Map.groupBy, Promise.withResolvers, regex /v flag.
    • ES2025: iterator helpers (.map, .filter, .take, .toArray on iterators), Promise.try (engine-dependent), RegExp.escape.
    • Still Stage 3 / rolling out in 2026: Temporal, decorators, the pipe operator, pattern matching — polyfill or wait.

    Best practices

    • Prefer shipped ES2024/2025 APIs over Stage-3 proposals in production paths.
    • Feature-detect (typeof Object.groupBy === "function") or ship a polyfill for Safari versions that lag.
    • Track proposals at github.com/tc39/proposals — do not assume a Stage-3 feature ships next June.

    Interview questions

    What is the difference between Object.groupBy and Map.groupBy?(Intermediate)

    Object.groupBy returns a plain object (null prototype) whose keys are strings/symbols coerced from the callback. Map.groupBy returns a Map and can use any key type (numbers, objects) without string coercion.

    Name two ES2025 features that are safe to use in Node 22 today.(Beginner)

    Iterator helpers (for example values().map().toArray()) and Object.groupBy/Map.groupBy from ES2024 are available in Node 22. Promise.try and Temporal still need a feature check or polyfill depending on the engine.

    Hands-on lab

    Lab: Run the playground snippet, then change the filter to keep even numbers and take the first three. Confirm the printed JSON matches your expectation.

    Examples

    Verified on Node.js 22 — these APIs are available without a polyfill:

    js
    const nums = [1, 2, 3, 4, 5, 6];
    const grouped = Object.groupBy(nums, (n) => (n % 2 ? "odd" : "even"));
    console.log(JSON.stringify(grouped));
    const doubled = [1, 2, 3].values().map((n) => n * 2).toArray();
    console.log(JSON.stringify(doubled));
    const firstOdds = nums.values().filter((n) => n % 2 === 1).take(2).toArray();
    console.log(JSON.stringify(firstOdds));
    const byLen = Map.groupBy(["aa", "b", "ccc", "dd"], (s) => s.length);
    console.log(JSON.stringify([...byLen.entries()]));

    Output

    {"odd":[1,3,5],"even":[2,4,6]}
    [2,4,6]
    [1,3]
    [[2,["aa","dd"]],[1,["b"]],[3,["ccc"]]]

    Object.groupBy returns a null-prototype object. Iterator helpers are lazy until you call a consuming method such as toArray(). Feature-detect before use in older browsers, or transpile/polyfill via core-js.

    Common pitfalls

    • Treating Temporal or pattern matching as "already everywhere" in 2026 — they still need polyfills or flags.
    • Forgetting that iterator helpers are lazy — nothing runs until a sink like toArray() or a for...of.
    • Spreading Object.groupBy results into objects that reintroduce Object.prototype.

    Try it yourself

    Edit the JS panel and press Run — profile in Chrome DevTools Performance and Memory panels.

    Try it yourself

    Preview

    Summary

    JS in 2026 is mostly about using ES2024/2025 features that already shipped — groupBy and iterator helpers — while keeping Temporal and other Stage-3 work behind polyfills.

    Key takeaways

    • Ship what engines already support; polyfill Stage-3 features.
    • Object.groupBy and iterator helpers are the practical 2024–2025 wins.
    • Follow TC39 proposals before betting a release on them.
    Ready to mark this lesson complete?Track your journey across the entire course.