Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface defining isNonNegativeInteger with methods for testing for primitives and objects, respectively.

Hierarchy

  • IsNonNegativeInteger

Callable

  • __call(value: any): boolean
  • Tests if a value is a nonnegative integer.

    Parameters

    • value: any

      value to test

    Returns boolean

    boolean indicating whether value is a nonnegative integer

    Example

    var bool = isNonNegativeInteger( 5.0 );
    // returns true

    Example

    var bool = isNonNegativeInteger( new Number( 5.0 ) );
    // returns true

    Example

    var bool = isNonNegativeInteger( -5.0 );
    // returns false

    Example

    var bool = isNonNegativeInteger( 3.14 );
    // returns false

    Example

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

Index

Methods

isObject

  • isObject(value: any): boolean
  • Tests if a value is a number object having a nonnegative integer value.

    Parameters

    • value: any

      value to test

    Returns boolean

    boolean indicating if a value is a number object having a nonnegative integer value

    Example

    var bool = isNonNegativeInteger.isObject( 3.0 );
    // returns false

    Example

    var bool = isNonNegativeInteger.isObject( new Number( 3.0 ) );
    // returns true

isPrimitive

  • isPrimitive(value: any): boolean
  • Tests if a value is a number primitive having a nonnegative integer value.

    Parameters

    • value: any

      value to test

    Returns boolean

    boolean indicating if a value is a number primitive having a nonnegative integer value

    Example

    var bool = isNonNegativeInteger.isPrimitive( 3.0 );
    // returns true

    Example

    var bool = isNonNegativeInteger.isPrimitive( new Number( 3.0 ) );
    // returns false