简介Introduction:JavaScript Versions: ES6 and Before

至今还用ES6的原因?
Now, you may be asking, what makes an update in 2015 still relevant today when there are more recent updates like ES7 and ES8?
Well, despite the release of newer versions, ES6 is actually the biggest update made to ECMAScript since the first edition released in 1997! Some developers even refer to ES6 as “Modern JavaScript” because of all the major additions. There were so many great features added to help JavaScript developers that include:
• new keywords like let and const to declare variables, • new function syntax using Arrow functions, • creation of Classes, • parameters with default values, • promises for asynchronous actions, • and many more!
Up-to-date browsers now support most of the ES6 features which allow developers to take advantage of these new additions. ES6 ultimately allows programmers to save time and write more concise code. Take for example pre-ES6 syntax for function expressions:
var greeting = function() {
console.log('Hello World!');
};
With ES6 arrow functions, we can transform the expression above into:
const greeting = () => console.log('Hello World');