Skip to main content

isDigits

Callable

  • isDigits(xs: string): boolean

  • Checks if xs contains only digits.

    Example

    isDigits("1234")
    // => true

    isDigits("1234foobar")
    // => false

    isDigits("123.45")
    // => false

    Parameters

    • xs: string

      The value to check.

    Returns boolean

    true if xs only contains digits, false otherwise.