isFloat and isInteger in javascript
Found some interesting way to check isFloat and isInteger in javascript on stackoverflow
function isFloat(n) {
return n === +n && n !== (n|0);
}
function isInteger(n) {
return n === +n && n === (n|0);
}
Found some interesting way to check isFloat and isInteger in javascript on stackoverflow
function isFloat(n) {
return n === +n && n !== (n|0);
}
function isInteger(n) {
return n === +n && n === (n|0);
}