Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "assert/is-truthy/docs/types/index.d"

Index

Functions

Functions

Export assignment isTruthy

  • isTruthy(value: any): boolean
  • Tests if a value is truthy.

    Parameters

    • value: any

      value to test

    Returns boolean

    boolean indicating whether a value is truthy

    Example

    var bool = isTruthy( true );
    // returns true

    Example

    var bool = isTruthy( [] );
    // returns true

    Example

    var bool = isTruthy( false );
    // returns false

    Example

    var bool = isTruthy( null );
    // returns false

    Example

    var bool = isTruthy( '' );
    // returns false

    Example

    var bool = isTruthy( 0 );
    // returns false

    Example

    var bool = isTruthy( void 0 );
    // returns false

    Example

    var bool = isTruthy( NaN );
    // returns false