Checks if a given value is a truthy value.
isTruthy(true)// => trueisTruthy([])// => trueisTruthy({})// => trueisTruthy(false)// => falseisTruthy(on)// => false Copy
isTruthy(true)// => trueisTruthy([])// => trueisTruthy({})// => trueisTruthy(false)// => falseisTruthy(on)// => false
The type of the value to check.
The value to be checked.
true if the value is truthy and not null or undefined, false otherwise.
true
null
undefined
false
Generated using TypeDoc v0.24.7
Checks if a given value is a truthy value.
Example