Definition and Usage The isFinite() function is used to check if a value is a finite number. Syntax isFinite(number) Paramet...
Definition and Usage
The isFinite() function is used to check if a value is a finite number.
Syntax
Parameter | Description |
number | Required. The value to be tested |
Example
In this example we use isFinite() to check for finite numbers:
<script type="text/javascript"> document.write(isFinite(123)+ "<br />");
document.write(isFinite(-1.23)+ "<br />");
document.write(isFinite(5-2)+ "<br />");
document.write(isFinite(0)+ "<br />");
document.write(isFinite("Hello")+ "<br />");
document.write(isFinite("2005/12/12")+ "<br />"); </script> |
The output of the code above will be:
true
true
true
true
false
false |