This is the index of the modern JavaScript features covered in this section, grouped by what you use them for. Each row names the ECMAScript edition that introduced the feature and links to the page that explains it. Larger features have their own page; closely related everyday features are explained together in the three topic pages, Core language, Async and modules and Objects and collections.
New to the language? Start with the Basics, then read the three topic pages, then pick feature pages as you need them. For the edition-by-edition view, see ECMAScript versions.
| Feature |
Edition |
What it gives you |
| Block bindings: let and const |
ES2015 |
Block scope, the temporal dead zone, and choosing const, let or var. |
| Arrow functions |
ES2015 |
Short functions that use the surrounding this. |
| Default parameters |
ES2015 |
Parameter defaults that apply only to undefined. |
| Destructuring |
ES2015 |
Unpack objects and arrays into variables and parameters. |
| Template literals |
ES2015 |
Interpolation, multi-line strings and tagged templates. |
| Object shorthand |
ES2015 |
Concise properties and methods in object literals. |
| Computed property names |
ES2015 |
Dynamic keys in object literals and classes. |
| Rest/spread properties |
ES2015 arrays, ES2018 objects |
Copy, merge and omit with ..., plus rest parameters. |
| Binary and octal literals |
ES2015 |
0b and 0o number literals. |
| Exponentiation operator |
ES2016 |
** and **= instead of Math.pow. |
| Trailing commas |
ES5 to ES2017 |
Cleaner diffs in lists, parameters and calls. |
| Optional catch binding |
ES2019 |
catch without an unused error variable. |
| Optional chaining |
ES2020 |
?. reads that stop at null or undefined. |
| Nullish coalescing |
ES2020 |
?? defaults that keep 0 and empty strings. |
| Logical assignment |
ES2021 |
&&=, ||= and ??=. |
| Numeric separators |
ES2021 |
1_000_000 style number literals. |
| Hashbang comments |
ES2023 |
Executable script files with #!. |
| Tail calls |
ES2015 |
Proper tail calls: specified, but only shipped in Safari. |
| Feature |
Edition |
What it gives you |
| Classes |
ES2015, fields ES2022 |
Constructors, methods, inheritance, fields and getters. |
| Private fields |
ES2022 |
Real encapsulation with #name. |
| Private methods |
ES2022 |
Hidden helper methods and accessors. |
| Static blocks |
ES2022 |
One-time class initialization logic. |
| Object.assign |
ES2015 |
Copy properties onto an existing object. |
| Symbols |
ES2015 |
Unique keys and language hooks such as Symbol.iterator. |
| Proxy |
ES2015 |
Intercept reads, writes and calls. |
| Reflect API |
ES2015 |
Object operations as functions, for proxy traps. |
| Object.keys |
ES5 |
List an object’s own enumerable keys. |
| Object.values |
ES2017 |
Read an object’s values. |
| Object.entries |
ES2017 |
Loop over and transform key-value pairs. |
| Object.getOwnPropertyDescriptors |
ES2017 |
Copies that keep getters and setters. |
| Object.hasOwn |
ES2022 |
Safe own-property checks. |
| globalThis |
ES2020 |
One name for the global object in every environment. |
| Error cause |
ES2022 |
Chain errors with { cause }. |