||1 [Javascript] Nullish coalescing operator (??) const defaultValue = 0; const a = defaultValue || 3; const b = defaultValue ?? 3; console.log(a); // 3 console.log(b); // 0 || 을 대체해서 사용. 기존 || 는 undefined와 null 말고도 '' 나 0 역시 false 로 처리. 2022. 6. 6. 이전 1 다음