Skip to content
Related Articles
JavaScript Number Positive_INFINITY property
• Last Updated : 08 Sep, 2020

Below is the example of the Number Positive_INFINITY property.

• Example:
 ``
• Output:
`Infinity`

In javascript Number.POSITIVE_INFINITY represents the largest positive value i.e positive infinity. Actually value of Number.POSITIVE_INFINITY is the same as the value of the global object’s Infinity property.

Syntax:
It can be assigned to a variable in the following way.

`var a = Number.POSITIVE_INFINITY`

Now, we know what is Number.POSITIVE_INFINITY, let’s look at some examples to see the result of some arithmetic operations performed on Number.POSITIVE_INFINITY.

• Example 1: When we multiply any positive number including Number.POSITIVE_INFINITY by Number.POSITIVE_INFINITY the result is Number.POSITIVE_INFINITY.
 ``

Output:

`Infinity`
• Example 2: When we multiply any negative number with Number.POSITIVE_INFINITY the result is negative Infinity.
 `

Output:

`Infinity`
• Example 3: When we divide any positive or negative number by Number.POSITIVE_INFINITY the result is 0.
 ``

Output:

`0`
• Example 4: When we multiply Number.POSITIVE_INFINITY by 0, result is NaN.
 ``

Output:

`NaN`
• Example 5: When we divide Number.POSITIVE_INFINITY by any negative number except Number.NEGATIVE_INFINITY, result is Number.NEGATIVE_INFINITY.
 ``

Output:

`Infinity`
• Example 6: When we divide Number.POSITIVE_INFINITY by any positive number except Number.POSITIVE_INFINITY, result is Number.POSITIVE_INFINITY.
 ``

Output:

`Infinity`
• Example 7: When we divide Number.POSITIVE_INFINITY by either NEGATIVE_INFINITY or POSITIVE_INFINITY, result is NaN.
 ``

Output:

`NaN`

Supported Browsers:

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

My Personal Notes arrow_drop_up