Pure JavaScript: a function like jQuery's isNumeric()

javascript

Solution

There's no `isNumeric()` type of function, but you could add your own:

function isNumeric(n) {
  return !isNaN(parseFloat(n)) && isFinite(n);
}

NOTE: Since `parseInt()` is not a proper way to check for numeric it should NOT be used.

Problem

Is there is any function like `isNumeric` in pure JavaScript? I know jQuery has this function to check the integers.

Original source

Related problems