The function Number.isInteger()
is a static function on Number
handles zero in different ways
the literal 0
is an integer
the float value 0.000
is also an integer
the string 0
is NOT an integer
also sees the number 1 in different ways
the sum of 0.01
and 0.99
is an integer
the sum of 0.5 + 0.6 is NOT an integer
the result of parseInt("1")
is an integer
the string "1" is NOT an integer
identifies many things NOT as integer
Number()
(which returns a 0) is an integer
the object literal {}
is NOT an integer
the float value 0.1
is not an integer
Number.Infinity
is not an integer
NaN
is also not an integer
Related Katas
Number API
Number.isInteger()
Number.isNaN()
Number.parseInt()
Difficulty Level
BEGINNER
First Published
25 June 2015
Stats
13 tests to solve