ES5, released on 2009
ES6, released on 2015 (very large scope of features)
Each next version is released once a year, and would include much less features.
ECMAScript 6 compatibility table - https://kangax.github.io/compat-table/es6/
ECMAScript 2016+ compatibility table - https://kangax.github.io/compat-table/es2016plus/
- Block scoping with let and const
- Block-level functions
- Template strings
- Unicode support
- Function default parameters
- Rest parameters and spread operator
- Arrow functions with "this" being statically bound
- Tail call optimization
- Destructuring (inverse of construction)
- Classes, subclassable built-ins
- Iterators and generators
- Enhanced object literals
- Typed arrays
- Symbols
- Map and Set (weakmap and weakset)
- Promises
- Built-in types API additions
- binary and octal literals
- Proxies and reflection api
Exploring ES2016 and ES2017 - https://exploringjs.com/es2016-es2017/index.html
- API enchancements:
Array.prototype.include()
,Object.getOwnPropertyDescriptors()
,String.prototype.padEnd/padStart()
(Node 8+) - exponentiation operator:
number ** pow
- async/await functions (Node 8+, Edge)
- trailing commas in function calls and signatures are lega (Node 8+, Edge)
Exploring ES2018 and ES2019 - https://exploringjs.com/es2018-es2019/toc.html
- async iterators and generators (Node 10+, not supported in Edge)
- object rest/spread properties (Node 8+, not supported in Edge)
- "s" (dotAll) flag for regular expressions (Node 8+ Not supported in Edge, Firefox, TypeScript compiler.)
Promise.prototype.finally
(Node 10+, Edge 18+)Array.prototype.flat()
,Array.prototype.flatMap()
methods (Node 12+, TypeScript. Not supported by by Firefox, Edge, Babel compiler)Object.fromEntries()
(Node 12+, TypeScript. Not supported: Babel, Edge, Firefox).