falsy

A value that counts as false in a condition: false, 0, -0, 0n, the empty string, null, undefined and NaN.

In more detail

The || operator treats every falsy value as missing, which is why ?? is safer for defaults. NaN means not a number.

Related terms

Taught in

References