Number.isInteger(value)
//returns a Boolean
Number.isInteger(value)
/**
* verifie si value est de type int
* check if value is int
*
* @return {boolean}
*/
function isInt(value) {
return !isNaN(value) && (function(x) { return (x | 0) === x; })(parseFloat(value))
}
let testString="5";
if(Number.isInteger(parseFloat(testString))){
console.log("we are a int of some sort");
}
// 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")