JavaScript isFinite() Function

The isFinite() function determines whether a number is a finite, legal number. Tip: This function returns false if the value is +infinity, -infinity, or NaN.

Syntax

isFinite(value)

Example


<script language="JavaScript">

document.write(encodeURI(uri)+ "");
document.write(decodeURI(uri));
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>

Output

true
true
true
true
false
false

DOWNLOAD SOLUTION HERE