Check if given input is truthy (so not 0, NaN, "", false, or nullish).
input
isTruthy(42); // trueisTruthy(true); // trueisTruthy(false); // falseisTruthy(0); // false
Returns true if truthy, false otherwise.
true
false
Value to check.
Check if given
input
is truthy (so not 0, NaN, "", false, or nullish).Example
Returns
Returns
true
if truthy,false
otherwise.