Intermediate JavaScript
Q57 / 100

What is the Nullish Coalescing operator ??

Correct! Well done.

Incorrect.

The correct answer is B) Returns the left operand unless it is null or undefined, in which case returns the right

B

Correct Answer

Returns the left operand unless it is null or undefined, in which case returns the right

Explanation

const name = user.name ?? "Anonymous"; only falls back for null/undefined, not 0 or "" (unlike ||). Use ??= for assignment: x ??= default.

Progress
57/100