判断一个数字是不是整数

function isInteger(num) {
if (!isNaN(num) && num % 1 === 0) {
return true;
} else {
return false;
}

}
var a = 5.9
var isNum = isInteger(a);
console.log(isNum)

原文地址:https://www.cnblogs.com/lj8023/p/10418301.html