JS Coding Questions Logo
JS Coding Questions
#376💼 Interview💻 Code

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

Advertisement

728x90

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

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

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 34

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
376of476
How do you verify that an argument is a Number or not | JSCodingQuestions.com