JavaScript ES6+ Features Reference

Key JavaScript features from ES6 through ES2022: arrow functions, template literals, destructuring, spread, async/await, optional chaining, nullish coalescing, and top-level await.

The data

Features

NameVersionDescriptionExample
Arrow FunctionsES6 (2015)Concise function syntax with lexical this bindingconst add = (a, b) => a + b;
Template LiteralsES6 (2015)String interpolation with backticks and ${}`Hello, ${name}!`
DestructuringES6 (2015)Unpack values from arrays or objects into variablesconst {name, age} = person;
Spread OperatorES6 (2015)Expand iterables into individual elementsconst merged = [...arr1, ...arr2];
Async/AwaitES8 (2017)Syntactic sugar over Promises for async codeconst data = await fetch(url);
Optional ChainingES2020Safe nested property access without null checkuser?.profile?.name
Nullish CoalescingES2020Fallback for null/undefined only (not falsy)const x = value ?? defaultValue;
Top-level AwaitES2022Use await outside async functions in modulesconst config = await loadConfig();

Fetch the same bytes

The static files are identical to what the API returns, but with no rate limit and no server round trip. Use the API when you want a query and a content type; use the files when you want to cache one document.

curl "https://yjtoon.com/api/dataset/javascript-es6-features?format=toon"
const res = await fetch(
  "https://yjtoon.com/static-data/dataset/javascript-es6-features.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • javascript
  • es6
  • web
  • reference