JavaScript
[JavaScript] 최신문법 정리
제로콜라먹는사람
2022. 1. 21. 23:26
반응형
Nullish Coalescing Operator(??)
좌항이 null
또는 undefined
일 경우에 우항을 반환해준다.
const one = null ?? "One"
const two = undefined ?? "Two"
const three = false ?? "Three"
console.log(one, two, three) // One Two false
...
반응형