Javatpoint Logo
Javatpoint Logo

JavaScript Number isInteger() method

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.

Test it Now

Output:

true true true 

Example 2

Let's see isInteger() method with some test cases.

Test it Now

Output:

true false 

Example 3

Let's see some values for which isInteger() method returns false.

Test it Now

Output:

false false false false false false

Next TopicJavaScript Math




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA