InterviewHubPRO
Section Overview
Q380

Question 380 of 521

Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

73%
JavaScript Internals (521 Qs)•Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

How do you verify that an argument is a Number or not

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

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