Table of Contents
ES6, also called ECMAScript 2015, is the sixth edition of the standard that defines JavaScript. It introduced features such as let, const, arrow functions, destructuring, promises, classes, and modules. Later editions have added more features.

Features you’ll see in everyday JavaScript
| Feature | Example and use |
|---|---|
| Block-scoped variables | const items = [] prevents reassigning items, while items.push('book') still works. Use let when the binding needs to change. |
| Arrow functions | items.map(item => item.toUpperCase()) applies a short callback. An arrow captures this from its surroundings. |
| Destructuring | const { name } = user reads a named property. const [first] = items reads the first array element. |
| Default arguments | function greet(name = 'Guest') { /* … */ } uses the default if the argument is missing or undefined. |
| Template literals | `Hello, ${name}!` inserts an expression into text. |
| Array spread and rest parameters | [...items, 'pen'] expands values into a new array. function list(...values) { /* … */ } collects arguments into an array. |

ES6 is the ECMAScript edition published in 2015.
What changed for larger programs
- Modules: Use
exportandimportto define what each file shares. In browsers, load a module script withtype="module". - Promises: Use
.then()for a result and.catch()for a rejection.asyncandawaitcame later and build on promises. - Classes: Use
classandextendsto organize behavior. JavaScript still uses prototypes under the class syntax.

ES6 gave developers more ways to organize and reuse JavaScript code.
Check compatibility before changing older code
Modern browsers and supported Node.js releases handle ES6. For legacy browsers, check both the syntax and built-in features you use. A transpiler can rewrite some syntax, while missing built-ins can require a polyfill. See the ECMAScript 2015 specification or practice with the JavaScript Fundamentals course.
Reader Comments 0
Sign in with email or Google to join the discussion.