Es2020 feture

 

1.globalThis

为了统一在nodejs中的global和webworker中的self

 

 

2.Promise.allSettled()

Const p1 = new Promise((resolve,reject)=>setTimeout())

 ES2020 new feature_操作符

 

 

 

与Promise.all的区别, promise.all遇到reject的时候会抛出错误

但allsettleed会等到resolve或reject

 

3.Nullish Coalescing Operator

ES2020 new feature_前端_02

 

ES2020 new feature_操作符_03

 

 

 ES2020 new feature_操作符_04

 

 

现在你可以使用??

ES2020 new feature_操作符_05

 

 

4.Optional Chaining Operator

ES2020 new feature_操作符_06

 

 

// error

 

现在可以使用?.操作符

ES2020 new feature_前端_07

 

 

5.BigInt

ES2020 new feature_操作符_08

 

 

ES2020 new feature_操作符_09

 

 

ES2020 new feature_前端_10

 

 

ES2020 new feature_前端_11