Summary of Vue front-end interview questions (15) What are the extensions of Es6?

As an upgraded version of Es5, Es6 adds a lot of syntax

Some new features of ES6

  1. Added block-level scope, let and const
  2. Added class to define classes
  3. A new basic data type symbol is added, symbol means unique, allowing to set default values, and not using the new keyword
  4. Added structure assignment
  5. Added arrow function and introduced rest parameter
  6. Function allows to set default value
  7. Added set and map data structures
  8. set can be used to quickly remove duplication
  9. The feature of map is that the key can be any type
  10. Added modularity, import and export.
  11. 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
  12. from() returns an array through an object with a length property
  13. 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
  14. ES6 natively provides a Proxy constructor to generate Proxy instances.
  15. 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.
  16. Added Generator and Iterator

Guess you like

Origin blog.csdn.net/Rick_and_mode/article/details/108623195