What value does the nullish-coalescing expression produce?
console.log(0 ?? 1);Answer & explanation
Answer: 0
Nullish coalescing uses its right operand only for null or undefined. Zero is preserved.
Practice operators with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
console.log(0 ?? 1);Answer: 0
Nullish coalescing uses its right operand only for null or undefined. Zero is preserved.