Skip to content
Related Articles

Related Articles

Improve Article

JavaScript isFinite() Function

  • Last Updated : 22 Dec, 2020

The JavaScript isFinite() function is used to check whether a number is a finite, legal number or not. It returns true for all the values except +infinity, -infinity, or NaN.

Syntax:

isFinite(value)

Parameters: This method takes a single parameter as mentioned above and discussed below:

  • value: It is a required value passed in the isFinite() function.

Return Value: It returns a Boolean value i.e. returns false if the value is +infinity, -infinity, or NaN, otherwise returns true.

Javascript




<!DOCTYPE html>
<html>
  
<body>
    <p>JavaScript isFinite() Function</p>
  
    <script>
        document.write(isFinite(12) + "<br>");
        document.write(isFinite(0) + "<br>");
        document.write(isFinite(12.3) + "<br>");
        document.write(isFinite("Geeks") + "<br>");
        document.write(isFinite("456") + "<br>");
        document.write(isFinite(-46) + "<br>");
    </script>
</body>
  
</html>

Output:

Supported Browsers:

  • Chrome
  • Firefox
  • Edge
  • Opera
  • Safari
My Personal Notes arrow_drop_up
Recommended Articles
Page :