isInteger()
JavaScript Number isInteger() method
Last Updated : 17 Mar 2025
The JavaScript number isInteger() method determines whether the given value is an integer. It returns true if the value is an integer, otherwise it returns false.
Syntax
The isInteger() method is represented by the following syntax:
Parameter
num - A number to be checked.
Return
A Boolean value.
JavaScript Number isInteger() method example
Here, we will understand isInteger() method through various examples.
Example 1
Let's see a simple example of isInteger() method.
Output:
Example 2
Let's see isInteger() method with some test cases.
Output:
Example 3
Let's see some values for which isInteger() method returns false.
Output:
false false false false false false