Type alias Falsy

Falsy: EmptyString | HTMLAllCollection | Nullish | 0 | 0n | false

Types that evaluates to false in JS.


Union type of the values that evaluate to false in JavaScript. Due to TypeScript type limitations NaN can't be included.


const falsyBoolean: Falsy = false;
const falsyHTMLAllCollection: Falsy = document.all;
const falsyNegativeZero: Falsy = -0;
const falsyNegativeZeroBigInt: Falsy = -0n;
const falsyNull: Falsy = null;
const falsyString: Falsy = "";
const falsyUndefined: Falsy = undefined;
const falsyZero: Falsy = 0;
const falsyZeroBigInt: Falsy = 0n;