PRACTICE / UNDERSTAND / REPEAT

JavaScript: Operators

Practice operators with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

20 questionsAnswers explainedFree · no login
Question 1 of 20
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.