api: "YAML JSON TOON Database" version: 1.0.0 format: json dataset: id: 11 slug: javascript-es6-features title: "JavaScript ES6+ Features Reference" description: "Key JavaScript features from ES6 through ES2022: arrow functions, template literals, destructuring, spread, async/await, optional chaining, nullish coalescing, and top-level await." category: "Programming Languages" category_slug: programming-languages tags: "javascript,es6,web,reference" view_count: 0 created_at: 1777673262 updated_at: 1777673262 data: features [8]{name,version,description,example}: "Arrow Functions","ES6 (2015)","Concise function syntax with lexical this binding","const add = (a, b) => a + b;" "Template Literals","ES6 (2015)","String interpolation with backticks and ${}","`Hello, ${name}!`" Destructuring,"ES6 (2015)","Unpack values from arrays or objects into variables","const {name, age} = person;" "Spread Operator","ES6 (2015)","Expand iterables into individual elements","const merged = [...arr1, ...arr2];" Async/Await,"ES8 (2017)","Syntactic sugar over Promises for async code","const data = await fetch(url);" "Optional Chaining",ES2020,"Safe nested property access without null check",user?.profile?.name "Nullish Coalescing",ES2020,"Fallback for null/undefined only (not falsy)","const x = value ?? defaultValue;" "Top-level Await",ES2022,"Use await outside async functions in modules","const config = await loadConfig();"