Function isValidHours

  • Checks if the given number is a valid hour in the 24-hour format.

    Parameters

    • n: number

      The number to be checked.

    Returns boolean

    A boolean indicating whether the number is a valid hour or not.

    Remarks

    This function checks if the given number is an integer and falls within the range of 0 to 23 (inclusive).

    Example

    isValidHours(12);  // returns true
    isValidHours(24); // returns false
    isValidHours(15.5); // returns false

Generated using TypeDoc