isFinite-2

 

Example of JavaScript isFinite:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <p>Click the button to check whether a number is a finite</p> <button onclick="isFiniteNumber()">Click it</button> <p id="sample"></p> <script> function isFiniteNumber() { var a = Number.isFinite(Infinity) + "<br>"; var b = Number.isFinite(NaN) + "<br>"; var c =Number.isFinite(2e64) + "<br>"; result = a+b+c; document.getElementById("sample").innerHTML = result; } </script> </body> </html>
Output