Falsy
type Falsy = false | null | undefined | 0 | 0n | "";
false, null, undefined, 0, 0n and the empty string. The type exists so that compact can say what it removes and return a narrowed array without a cast; NaN is falsy too but has no place in a type, since its type is number.
Examples
Shape
const values = [0, "", false, null, undefined];
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.