isInteger is a number js code example
Example 1: javascript is number an integer
Number.isInteger(value)
//returns a Boolean
Example 2: js check if string is integer
function isInt(str) {
return !isNaN(str) && Number.isInteger(parseFloat(str));
}
Example 3: js is variable int
// The === operator is used for checking
// the value and the type of a variable
var data = 1;
if (data === parseInt(data, 10))
alert("data is integer")
else
alert("data is not an integer")