ES6 was particularly noteworthy for several reasons:
- Better scope management with new variable keywords 'let' & 'const'.
- Less cluttered and more digestible code with addition of arrow functions.
- More universally intuitive syntax with ability to create classes.
- More powerful functions with ability to set default parameter values.
- Better efficiency with additions of 'Array.find()' & 'Array.findIndex()'.
- Easier exponentiation with addition of '**'.
The addition of the variable keywords 'let' and 'const' improved on the existing variable keyword 'var'. Before ES6, variables either belonged to function scope or global scope. The addition of 'let' and 'const' allowed for block scope. This created less buggy code.
Arrow functions are helpful in creating concise code. While a normal function declaration requires at least 3 lines of code, an arrow function can often accomplish the same in one line.
The ability to set default parameter values can greatly increase the effectiveness of your function. This allows for inputs that may not contain all the information that other inputs contain.
The additions of 'Array.find()' and 'Array.findIndex()' allows for quick and powerful solutions to array problems. It is common to use one of these built-in functions when dealing with an Array that contains one desired element.
For any programmers that like their code to mirror the way they think about a problem, the '' operator was a welcome addition. Before ES6 programmers used the 'Math.pow()' function for exponentiation. The addition of '' allows programmers to write code that looks similar to how one would write exponentiation on paper.
These updates were just some of many that were included with ES6. While ECMAScript is constantly evolving, I felt that ES6 was a special iteration and was worth exploring.