JavaScript is evolving rapidly. ES2024 brings Array grouping, well-formed Unicode strings, and other useful features.
Key Features¶
// Array grouping (ES2024) const people = [ { name: ‘Jan’, age: 30 }, { name: ‘Eva’, age: 25 }, { name: ‘Tom’, age: 30 }, ]; const byAge = Object.groupBy(people, p => p.age); // { 25: [{name:’Eva’,…}], 30: [{name:’Jan’,…},{name:’Tom’,…}] } // Promise.withResolvers const { promise, resolve, reject } = Promise.withResolvers(); // Temporal API (Stage 3) const now = Temporal.Now.plainDateTimeISO(); const date = Temporal.PlainDate.from(‘2025-03-15’);
Modern Syntax¶
// Optional chaining + nullish coalescing const city = user?.address?.city ?? ‘Unknown’; // Top-level await const data = await fetch(‘/api’).then(r => r.json()); // Structuring clone const deep = structuredClone(original); // at() — negative indexing const last = arr.at(-1);
Key Takeaway¶
Use modern syntax — groupBy, at(), structuredClone. Temporal will replace the Date object.