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

Operators · MCQQuestion link ↗

What value does the nullish-coalescing expression produce?

console.log(0 ?? 1);
Choose one answer
Answer & explanation

Answer: 0

Nullish coalescing uses its right operand only for null or undefined. Zero is preserved.