DEV Community

Discussion on: JavaScript ?? operator

Collapse
 
arlopezg profile image
Alejandro López

You could say it's a regular OR operator (||) but it's restricted to catch undefined and null instead of it being open to all falsey values (zero, empty string, etc.).

Collapse
 
lorenzojkrl profile image
Lorenzo Zarantonello

Yes! That is true. The nullish coalescing operator is often compared to the OR operator. That requires knowledge of some other concepts like truthy and falsy on top of how the OR operator works.

I just wanted to focus on one single concept:)
You comment stands true and I am glad you wrote it!