DEV Community

chandra penugonda
chandra penugonda

Posted on

Difference between OR logical operator (||) and Nullish coalescing operator

OR logical operator checks for falsy values.

Falsy values are false, undefined, null, 0, NaN, and a empty string

Nullish coalescing operator (??) only checks for undefined or null.

Top comments (0)