Is a string integer - Node.js String

Node.js examples for String:Parse

Description

Is a string integer

Demo Code


function isInt(aStr) {
  var i = parseInt(aStr);
  if (isNaN(i)) return false;
  i = i.toString();/*from  ww w  .  ja  v a 2 s. c  o m*/
  return (i == aStr);
}

Related Tutorials