Number isInteger() method

Find all information about the JavaScript isInteger() method of the Number object

If the passed value is an integer, it returns true. Boolean values, strings, objects, arrays, etc. all other things return false:

Number.isInteger(1) //true
Number.isInteger(-237) //true
Number.isInteger(0) //true

Number.isInteger(0.2) //false
Number.isInteger('Flavio') //false
Number.isInteger(true) //false
Number.isInteger({}) //false
Number.isInteger([1, 2, 3]) //false

Download mine for freeJavaScript beginner's manual

More js tutorials: