isFinite() function in JavaScript


The isFinite() function accepts a value and determines whether the given value is a finite number or not. If so, this method returns true else it returns false. You can also invoke this method using Number object.

Syntax

Its Syntax is as follows

isFinite(5655);

Example

 Live Demo

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var result1 = Math.min();
      document.write(isFinite(result1));
      document.write("<br>");
      var result2 = Number.isFinite(100/0);
      document.write(result2);
      document.write("<br>");
      var result3 = Math.max(25, 36, 862);
      document.write(isFinite(result3));
   </script>
</body>
</html>

Output

false
false
true

Updated on: 25-Jun-2020

34 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements