shlogg · Early preview
Ashutosh Biswas @ashutoshbw

JavaScript Falsy Values Explained

Truthy values in JS are considered true in Boolean contexts. Falsy values include false, 0, -0, 0.0, empty strings "", undefined, null and NaN. All else is truthy.

Truthy values are considered as true and falsy values are considered as false in Boolean contexts for example in conditionals and logical operators.
There are only the following falsy values in JavaScript:

The Boolean false value: false
The zero value of both Number and BigInt type: 

Number type: 0, -0, 0.0, 00, 0x0 etc. 
BigInt type: 0n, 0x0n, 0b0n etc.


Empty string value: "", '' and ``

undefined, null and NaN.

All the rest of the values in JavaScript are truthy values.
That's it. Thanks for reading! Let's connect on Twitter.