JavaScript Infinity Property
Complete Function Reference
Definition and Usage
The Infinity property is a numeric value that represents positive or negative infinity.
Infinity is
displayed when a number is higher than 1.7976931348623157E+10308, and -Infinity
is displayed when a number is lower than -1.7976931348623157E+10308.
Syntax
Tips and Notes
Note: Anything divided by Infinity is 0 and anything multiplied by
Infinity is Infinity.
Example
In this example we will show what happens if a number exceeds the infinity
limit:
<script type="text/javascript">
var t1=1.7976931348623157E+10308;
document.write(t1);
document.write("<br />");
var t2=-1.7976931348623157E+10308;
document.write(t2);
</script>
|
The output of the code above will be:
Try it yourself »
|
Complete Function Reference
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 4000 certificates already issued!
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|