Skip to content
Related Articles

Related Articles

Improve Article

JavaScript Infinity Property

  • Last Updated : 06 Jul, 2020

Below is the example of the Infinity Property.

  • Example:

        function test() {
            -3.645464512375121213E+1203466 +
            + 3.4548643575312453512345E+1203466);
  • Output:

The Infinity Property used to display Infinity when the floating point number’s upper limit is exceeded and -Infinity when the floating point number’s lower limit is exceeded. Here, Infinity denotes Positive Infinity and -Infinity represents Negative Infinity.


floating point no.

Return Value: It returns Infinity to represent Positive Infinity and -Infinity to represent Negative Infinity.

More example code for the above property are as follows:
Program 1:

<!DOCTYPE html>
        h1 {
            color: green;
        <button onclick="test()">
          3.4576917263943217389012348562315E+1203466 is
          the limit of a Floating Point Number.</p>
          Clicking the Press button will 
          showcase the Javascript Infinity Property.
        <p id="gfg"></p>
            function test() {
                  "gfg").innerHTML =
                  -3.4576917263943217389012348562315E+1203466 +
                  + 3.4576917263943217389012348562315E+1203466;


Supported Browsers:

  • Google Chrome
  • Firefox
  • Internet Explorer
  • Safari
  • Opera

    My Personal Notes arrow_drop_up
  • Recommended Articles
    Page :