[ECMAScript] ES2020

빛트·2022년 7월 14일
0

ECMASCRIPT

목록 보기
7/8
post-thumbnail

Bigint

let bigint = BigInt(3);
let bigint = 3n;

nullish coalescing

let val = null;
let val2 = val ?? 'val2'; // val2

Promise.allSettled

Promise.allSettled([fetch1(), fetch2(), fetch3()]).then((result) => {
	console.log(result[0]);
  	console.log(result[1]);
  	console.log(result[2]);
});

optional chaning

let arr = { key1: { b: "c" } };
let result = arr.key2?.c; // undefined

globalThis

let browserWindow = globalThis;
let nodeGlobal = globalThis;

0개의 댓글