_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

JavaScript Modern Syntax (ES2024)

27. 06. 2018 1 min read intermediate

JavaScript se rapidně vyvíjí. ES2024 přináší Array grouping, well-formed Unicode strings a další užitečné features.

Klíčové 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

Používejte moderní syntax — groupBy, at(), structuredClone. Temporal nahradí Date objekt.

javascriptes2024programming
Share:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.