InterviewBuddy
All interview questions

What does nullish coalescing do?

Beginner

Answer

The ?? operator uses a fallback only when the left side is null or undefined. Unlike logical OR, it preserves valid values such as 0, false, and an empty string.