Skip to main content
InterviewHubPRO
Section Overview
Q380

Question 380 of 536

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

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

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

senior LevelCode ExampleAsync & PromisesEvent LoopHTTP & REST APIs

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);
  }