0 votes
in JavaScript by
How do you verify that an argument is a Number or not in Javascript?

1 Answer

0 votes
by

The combination of IsNaN and isFinite methods are used to confirm whether an argument is a number or not.

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