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);
}

Related
How do i check that a number is a float or integer