Checks if value is classified as a Number primitive or object.
value
Number
Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the Number.isFinite method.
Infinity
-Infinity
NaN
Number.isFinite
The value to check.
Returns true if value is a number, else false.
true
false
5.6.0
[[isInteger]], [[toInteger]], [[[[toNumber]]]]
isNumber(3)// => trueisNumber(Number.MIN_VALUE)// => trueisNumber(Infinity)// => trueisNumber('3')// => false Copy
isNumber(3)// => trueisNumber(Number.MIN_VALUE)// => trueisNumber(Infinity)// => trueisNumber('3')// => false
Checks if
value
is classified as aNumber
primitive or object.Note: To exclude
Infinity
,-Infinity
, andNaN
, which are classified as numbers, use theNumber.isFinite
method.