Checks if value is an integer.
value
This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to number.
number
Optional
The value to check
true if value is integer, otherwise false.
true
false
isInteger(3); // Returns: trueisInteger(Infinity); // Returns: falseisInteger('3'); // Returns: falseisInteger([]); // Returns: false Copy
isInteger(3); // Returns: trueisInteger(Infinity); // Returns: falseisInteger('3'); // Returns: falseisInteger([]); // Returns: false
Alias