PRACTICE / UNDERSTAND / REPEAT
JavaScript practice question
Practice operators with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
1 questionAnswers explainedFree · no login
Try this question
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.