Options
All
  • Public
  • Public/Protected
  • All
Menu

Module isNumber

Index

References

Functions Lang

References

Renames and re-exports __type

Lang Functions

  • isNumber(value: any): value is number
  • 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.

    since

    5.6.0

    see

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

    example
    isNumber(3)
    // => true

    isNumber(Number.MIN_VALUE)
    // => true

    isNumber(Infinity)
    // => true

    isNumber('3')
    // => false

    Parameters

    • value: any

      The value to check.

    Returns value is number

    Returns true if value is a number, else false.