널병합 (1) 썸네일형 리스트형 Nullish coalescing operator (널 병합 연산자 ??) - 널병합연산자 (Nullish coalescing operator) - ?? // ?? 의 왼쪽 값이 Null, Undefined 일 때 ?? 오른쪽 값 대입 function printMessage(text){ const message = text ?? 'Nothing to Display'; console.log(message); } 비슷하지만 다른 Logical OR - || // Logical OR 왼쪽 값이 falsy 한 값 일 때 Logical OR 오른쪽 값 대입 // Falsy : https://developer.mozilla.org/ko/docs/Glossary/Falsy function printMessage3(text){ const message = text || 'Nothing to .. 이전 1 다음