Function isNumber

  • Checks if value is classified as a Number primitive or object.

    Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the Number.isFinite method.

    Parameters

    • value: any

      The value to check.

    Returns value is number

    Returns true if value is a number, else false.

    5.6.0

    [[isInteger]], [[toInteger]], [[[[toNumber]]]]

    isNumber(3)
    // => true

    isNumber(Number.MIN_VALUE)
    // => true

    isNumber(Infinity)
    // => true

    isNumber('3')
    // => false