a ?? b
a
null
undefined
b
x = a ?? b x = (a != null && a != undefined) ? a : b
??
||
let a = 0 console.log(a || 1) // 1 console.log(a ?? 1) // 0