-
Promise.allSettled
无论 fulfilled 或 rejected 都算是 settled
- Optional chaining
const thatOne = { } const lastname = thatOne.info?.lastname // no error! lastname equals undefined -
Nullish coalescing Operator
空值合并运算符。undefined 和 null 是 “Nullish”
- dynamic-import
import('../path/to/module') - globalThis
var getGlobal = function () { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } throw new Error('unable to locate global object'); }; var globals = getGlobal(); -
BigInt
计算
-(2^53-1)至 2^53-1范围之外的整数 -
String.prototype.matchAll
String.prototype.macth(reg with flag: global)不会匹配“子项”,也即是group,去掉global标记,则返回第一个匹配。如果获取到全局所有匹配项,包括子项呢?String.prototype.matchAll返回一个迭代器。
發佈於
Tue, 03/10 2020
𖦋