Function isNonZeroPositiveInteger

  • Checks if a given number is a positive integer.

    Parameters

    • int: number

      The number to check.

    Returns boolean

    A boolean indicating whether the input is a positive integer.

    Remarks

    This function uses the Number.isInteger method and a simple greater than zero.

    Example

    isNonZeroPositiveInteger(5); ;
    //=> true
    isNonZeroPositiveInteger(-5);;
    //=> false
    isNonZeroPositiveInteger(0); ;
    //=> false
    isNonZeroPositiveInteger(5.5);;
    //=> false

Generated using TypeDoc