Function isNegativeInteger

  • Checks if a given number is a negative integer.

    Parameters

    • int: number

      The number to check.

    Returns boolean

    A boolean indicating whether the input is a negative integer.

    Remarks

    This function uses the Number.isInteger method to check if the input is an integer, and then checks if it is less than or equal to 0.

    Example

    isNegativeInteger(-5); ;
    //=> true
    isNegativeInteger(0); ;
    //=> true
    isNegativeInteger(5); ;
    //=> false

Generated using TypeDoc