kingberrill of Javascript
7/5/2017 - 10:44 AM

is Integer f the value of a variable is an integer, then the numeric value of it's parseFloat() and parseInt() equivalents will be the same

is Integer

f the value of a variable is an integer, then the numeric value of it's parseFloat() and parseInt() equivalents will be the same, so:

function is_int(value){
  if((parseFloat(value) == parseInt(value)) && !isNaN(value)){
      return true;
  } else {
      return false;
  }
}