Skip to content

Xotic750/is-truthy-x

Repository files navigation

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

is-truthy-x

Test if a given value is truthy.

module.exportsboolean

This method tests if a given value is truthy.

Kind: Exported member
Returns: boolean - true if the value is truthy: otherwise false.

Param Type Description
value * The value to test.

Example

import isTruthy from 'is-truthy-x';

console.log(isTruthy()); // false
console.log(isTruthy(0)); // false
console.log(isTruthy('')); // false
console.log(isTruthy(false)); // false
console.log(isTruthy(null)); // false

console.log(isTruthy(true)); // true
console.log(isTruthy([])); // true
console.log(isTruthy(1)); // true
console.log(isTruthy(function() {})); // true