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

What is the purpose of isFinite function

Advertisement

728x90

The isFinite() function is used to determine whether a number is a finite, legal number. It returns false if the value is +infinity, -infinity, or NaN (Not-a-Number), otherwise it returns true.

javascript
1isFinite(Infinity); // false
2
3isFinite(NaN); // false
4
5isFinite(-Infinity); // false
6
7isFinite(100); // true

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 86

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
85of476