As an upgraded version of Es5, Es6 adds a lot of syntax
Some new features of ES6
Added block-level scope, let and const
Added class to define classes
A new basic data type symbol is added, symbol means unique, allowing to set default values, and not using the new keyword
Added structure assignment
Added arrow function and introduced rest parameter
Function allows to set default value
Added set and map data structures
set can be used to quickly remove duplication
The feature of map is that the key can be any type
Added modularity, import and export.
Some APIs have been added to the array, such as isArray (to determine whether it is an array) / from / of methods; the array instance has new entries(), keys() and values() methods
from() returns an array through an object with a length property
The static method of the of() array makes up for the difference in the behavior of the array due to the number of parameters (for example, there is only one parameter 3 newArray returns an array of length 3, and of() returns an array with a parameter of 3, and the behavior is very uniform) entries ()Returns an iterative object of an array, which contains the key-value pairs of the array keys() loop keys values() loop values
ES6 natively provides a Proxy constructor to generate Proxy instances.
The proxy builds a layer of interception on the outer layer of the target object, and certain operations on the target object from the outside world must be intercepted through this layer. new Proxy() means to generate a Proxy instance, it receives two objects, the first is the object to be intercepted and the second is to customize the interception behavior.