DEV Community


Discussion on: Modern Javascript - II

sinhapiyush profile image
Piyush Sinha Author

a ll b returns b if a is falsey value.

In Javascript, a lot of values are falsey, like empty strings, the number 0, undefined, null, false, NaN, and so on.

However, a lot of times you might want to check if a variable is either undefined or null, like when it's okay for a variable to have an empty string, or even a false value. In such cases, (??) is used.