English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript isInteger() Method

 JavaScript Number Object

isInteger()The method determines whether the passed value is an integer.

If the passed parameter is an integer, it returns true; otherwise, it returns false.

If the passed parameter is NaN or infinite, it returns false.

Syntax:

Number.isInteger(value)
Number.isInteger(0); // true
Number.isInteger(1); // true
Number.isInteger(20);// true
Number.isInteger(25);// true
Number.isInteger(-100000);   // true
Number.isInteger(0.1);   // false
Number.isInteger(3.14);  // false
Number.isInteger(NaN);   // false
Number.isInteger(Infinity);  // false
Number.isInteger('10');  // false
Number.isInteger(true);  // false
Number.isInteger(false); // false
Test See‹/›

Browser Compatibility

The number in the table specifies the first browser version that fully supports the isInteger() method:

Method
isInteger()191615912

Parameter Value

ParameterDescription
valueThe value to be tested is an integer

Technical Details

Return Value:A boolean value indicating whether the given value is an integer
JavaScript Version:ECMAScript 6

 JavaScript Number Object