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 CodingAdvertisement
728x90
376of476