ECMAScript 新特性

1. es2022

     (1) #声明私有属性和私有方法:声明它的范围内引用

     (2)#prop in obj 检查私有属性

     (3)顶层使用await 无需async function

     (4)throw new Error(mas:'XXXX',cause:'YYY')

     (5)索引方法 at() :string array

     (6)正则/d:可获取开始结束索引

     (7)Object.hasOwn(obj,prop) 检查自有属性, in可检查包含继承属性

    

   

posted @ 2022-08-22 18:45  卷叶小树  阅读(14)  评论(0编辑  收藏  举报