JavaScript Internals (521 Qs)•Part 5: ES6+ Modern Syntax, Classes, Modules & Destructuring (254 - 328)
List down some of the features of ES6
Below are the list of some new features of ES6,
- Support for constants or immutable variables
- Block-scope support for variables, constants and functions
- Arrow functions
- Default parameters
- Rest and Spread Parameters
- Template Literals
- Multi-line Strings
- Destructuring Assignment
- Enhanced Object Literals
- Promises
- Classes
- Modules
Practical Code Example
javascript
// Prominent ES6 (ECMAScript 2015) Features:
const arrow = () => 'Arrow function';
const { a, b } = { a: 1, b: 2 }; // Destructuring
const template = `Value: ${a}`; // Template Literals
class App {} // Classes
const p = new Promise(res => res('ES6')); // Promises