[Nullish coalescing operator ??]

let name;
console.log(name || "babo"); // babo

name = "";
console.log(name || "babo"); // babo
// OR 연산자는 falsy 면 값이있어도 무시해버림

console.log(name ?? "babo"); // 0
// nullish 연산자는 undefined , null 일때만 무시

[Optional Chainning ?.]

// Object
const lynn = { name : "lynn" };
console.log(lynn?.profile?.email); // undefined

// Array
let color = ['red', 'green', 'blue'];
console.log(color?.[1]);// green

color = null;
console.log(color?.[1]);// undefined

// Function
let myFunc = () => 'Hello World';
console.log(myFunc?.()); // Hello World

myFunc = null;
console.log(myFunc?.()) // undefined

[Promise.allSettled]

Promise.all 쓸때

Promise.allSettled 쓸때