Returns the right-hand operand when the left-hand operand is null or undefined.
Syntax
value ?? defaultValueExample
Enter values below to update the example in real time.
const→name→console→zero→nullish→const name = null ?? "default";
console.log(name); // "default"
const zero = 0 ?? 42;
console.log(zero); // 0 (0은 nullish가 아님)