ES6 (short for ECMAScript 2015) was released in 2015, and it introduced a lot of new features. ECMAScript is a standardized scripting language, and JavaScript is one implementation of it. In this section, we will go through the most important features released in ES6 that we will be using in the following sections.
Basics of ES6
Understanding constants
Constants, or immutable variables, can be defined by using a const keyword, as shown in the following code. When using the const keyword, the variable content cannot be reassigned:
const PI = 3.14159;
The scope of const is block scoped, which is the same as the scope for let. This means that the const variable can only be used inside the block in which it is defined. In practice...