ES 8/9/10 特性介绍

ES8

  1. async / await
  2. Object.values()
  3. Object.entries()
  4. String padding: String.prototype.padStart / String.prototype.padEnd
  5. 函数参数列表结尾允许逗号
  6. Object.getOwnPropertyDescriptors()
  7. SharedArrayBuffer对象
  8. Atomics对象

ES9

  1. Promise.finally()
  2. Rest/Spread 属性
  3. 正则表达式命名捕获组
  4. 正则表达式反向断言
  5. 正则表达四dotAll模式
  6. 正则表达式Unicode转义
  7. 非转义系列的模板字符串

ES10

  1. 行分隔符(U+2028)和段分隔符(U+2029)符号现在允许在字符串文字中,与JSON匹配
  2. 更加友好的JSON.stringify()
  3. 新增了Array的flat()方法和flatMap()方法
  4. 新增了String的trimStart()方法和trimEnd()方法
  5. Object.fromEntries()
  6. Symbol.prototype.description
  7. String.prototype.matchALL()
  8. Function.prototype.toString()现在返回精确字符,包括空格和注释
  9. 修改catch绑定
  10. 新的基本数据类型BigInt。现在一共是7种基本数据类型,分别是:String、Number、 Boolean、 Null 、Undefined 、Symbol 、BigInt

参考链接
https://juejin.im/post/5bfe003f5188252bf829c3fb
https://juejin.im/post/5ca2e1935188254416288eb2
https://zhuanlan.zhihu.com/p/67492465
https://github.com/yangkean/blog/issues/9
https://www.cnblogs.com/ceceliahappycoding/p/11354353.html

猜你喜欢

转载自www.cnblogs.com/zxxsteven/p/11535493.html