1. Why study ES6
-
Inherent shortcomings of the ES5 language, such as variable promotion, inflexible approach to built-in objects, incomplete modular implementation, etc.
-
Get ready for future Vue, especially the React framework.
-
Most corporate projects currently use ES6.
Introduction to ES6
ECMAscript6.0 (ES6) is the next generation standard for the JavaScript language, which was officially released in June 2015. Its goal is to make JavaScript an enterprise-level development language that can be used to write complex, large-scale applications
ES6 is both a historical term and a general reference, meaning the next generation of JavaScript standard after 5.1 version, covering ES2015, ES2016, ES2017, etc., and ES2015 is the official name, especially refers to the official version of the language standard released in that year
New features of ES6
-
Let and const commands
-
Es6 template character string
-
Enhanced function
-
Extended string, object, array functionality
-
Deconstruction assignment
-
Symbol
-
The Map and Set
-
Iterators and generators
-
Promise object
-
The Proxy object
-
The use of the async
-
Class class
-
Modular implementation
Let and const
-
Let declares variables without variable promotion
-
Is a block-level scope
-
Cannot duplicate declaration
Note: Const declares constants. Once declared, it cannot be changed