笔记-ES6 新功能

时间:2019-02-16
本文章向大家介绍笔记-ES6 新功能,主要包括笔记-ES6 新功能使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

ES6 新功能
    * const 声明常量,let 声明变量。都不可重复声明
    * 块级函数
    * 箭头函数
        :表达式体
        :语句体
        :lexical this
    * 函数参数
        :默认值
        :剩余参数
        :spread 操作符 ...
    * 字符串插值
    * 字面量
        :二进制 0b1011
        :八进制 073434
    * 对象属性
        :属性简写
        :计算属性名
        :方法属性简写
    * 解构赋值
        :数组匹配 [a, b] = [b, a]; [a, , b] = [1, 2, 3]
        :对象匹配 {x, y} = {x: 10, y: 20}
        :对象深度匹配 {x: a, y: b, z:{zz: c} = obj
        :配置设置默认值
        :参数内匹配
        :fail-soft 解构
    * 模块
        :export、import
        :default & *
    * 类
        :定义,class,constructor
        :继承 extends,super
        :从表达式继承
        :静态成员 static
        :getter,setter
    * symbol
        :symbol 类型
        :symbol.for
        :symbol.iterator & for..of
    * generator(n/a)
    * map/set, weakmap/weakset
        : map 
        : set
        : weak-link
    * typed array
    * new built-in methods
        : Object.assign
        : [].find, [].findIndex
        : "aa".repeat(4)
        : "".startsWith, endsWidth, includes
        : Number.isNaN, isFinite
        : Number.isSafeInteger
        : Math.trunc
        : Math.sign 0, -0, 1, -10
    * promise
    * meta-programming
        : proxying
        : reflection, Reflect
    * internationalization & localization
        : collation
        : number formatting
        : currency formatting
        : date/time formatting