truthy and falsy - mmedrano9438/peripheral-brain GitHub Wiki

a truthy value is a value that is considered true when encountered in a Boolean context. All values are truthy unless they are defined as falsy. That is, all values are truthy except false, 0, -0, 0n, "", null, undefined, NaN, and document.all if (true) if ({}) if ([]) if (42) if ("0") if ("false") if (new Date()) if (-42) if (12n) if (3.14) if (-3.14) if (Infinity) if (-Infinity)

A falsy (sometimes written falsey) value is a value that is considered false when encountered in a Boolean context.