JavaScript Number POSITIVE_INFINITY Property

Beginner
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Static property

What You’ll Learn

Number.POSITIVE_INFINITY is a static data property on Number (same API as MDN Number.POSITIVE_INFINITY). It is the positive Infinity value — the same as global Infinity. You get it when math overflows past MAX_VALUE, or from expressions like 1 / 0. This tutorial covers detection, IEEE-754 rules, five examples, and try-it labs.

01

Kind

Static property

02

Value

Infinity

03

Same as

global Infinity

04

From

Overflow / 1÷0

05

Writable

No

06

Baseline

Everywhere

Introduction

IEEE-754 floating point includes special non-finite values. Number.POSITIVE_INFINITY is how JavaScript names positive infinity — larger than every finite Number, including Number.MAX_VALUE.

It is the same value as the global Infinity identifier ((Number.POSITIVE_INFINITY === Infinity). Prefer the Number. form when you want infinity grouped with other Number constants, and because Number.POSITIVE_INFINITY is non-writable.

💡
Static Property

Static properties belong to Number itself. Always write Number.POSITIVE_INFINITY. There is no (5).POSITIVE_INFINITY, and you do not call it like a function.

This page is part of JavaScript Number Properties. Related tools include Number.isFinite(), Number.MAX_VALUE, and the twin constant Number.NEGATIVE_INFINITY.

Understanding the POSITIVE_INFINITY Property

Positive infinity is not a huge finite number — it is a special IEEE-754 value. Once a result becomes Infinity, further math often stays infinite (or becomes NaN in indeterminate cases like Infinity / Infinity).

  • It is a constant number, not a method.
  • Same value as global Infinity.
  • Greater than every finite Number: Number.POSITIVE_INFINITY > Number.MAX_VALUE.
  • Detect overflow with === Number.POSITIVE_INFINITY or !Number.isFinite(x).

📝 Syntax

General form of the static property Number.POSITIVE_INFINITY:

JavaScript
Number.POSITIVE_INFINITY

Value

The same as the global Infinity property.

Property attributes

AttributeValue
Writablefalse
Enumerablefalse
Configurablefalse

Common patterns

JavaScript
Number.POSITIVE_INFINITY;                 // Infinity
Number.POSITIVE_INFINITY === Infinity;    // true
Number.MAX_VALUE * 2;                     // Infinity
1 / 0;                                    // Infinity

Number.isFinite(Number.POSITIVE_INFINITY); // false

function checkNumber(bigNumber) {
  if (bigNumber === Number.POSITIVE_INFINITY) {
    return "Process number as Infinity";
  }
  return bigNumber;
}

⚡ Quick Reference

GoalCode
Read positive InfinityNumber.POSITIVE_INFINITY
Negative InfinityNumber.NEGATIVE_INFINITY
Detect exactly +∞x === Number.POSITIVE_INFINITY
Any non-finite?!Number.isFinite(x)
Overflow past MAX_VALUENumber.MAX_VALUE * 2
Divide by zero1 / 0Infinity

🔍 At a Glance

Four facts to remember about Number.POSITIVE_INFINITY.

Kind
static

Property on Number

Value
Infinity

Same as global Infinity

Finite?
no

isFinite → false

Mutable
no

Read-only constant

📋 POSITIVE_INFINITY vs MAX_VALUE vs Infinity

POSITIVE_INFINITYMAX_VALUEglobal Infinity
Finite?NoYesNo (same value)
MagnitudeSpecial +∞~1.8e+308Same as POSITIVE_INFINITY
Identity=== InfinityDifferent=== Number.POSITIVE_INFINITY
Writable on NumberNoNoGlobal may differ by env

Examples Gallery

Examples follow MDN Number.POSITIVE_INFINITY patterns. Use View Output or Try It Yourself for each case.

📚 Getting Started

Read the constant and see overflow produce Infinity.

Example 1 — Read Number.POSITIVE_INFINITY

Confirm it matches the global Infinity.

JavaScript
Number.POSITIVE_INFINITY;
Number.POSITIVE_INFINITY === Infinity;  // true
Try It Yourself

How It Works

Both names point at the same IEEE-754 positive-infinity value.

Example 2 — Overflow Past MAX_VALUE

Finite ceiling exceeded → Infinity.

JavaScript
Number.MAX_VALUE * 2;  // Infinity
Try It Yourself

How It Works

See also the MAX_VALUE tutorial for overflow guards on the finite side.

📈 Practical Patterns

MDN-style checks, division by zero, and isFinite.

Example 3 — MDN Overflow Guard

Branch when a value is exactly positive Infinity.

JavaScript
function checkNumber(bigNumber) {
  if (bigNumber === Number.POSITIVE_INFINITY) {
    return "Process number as Infinity";
  }
  return bigNumber;
}

checkNumber(Number.MAX_VALUE);      // 1.7976931348623157e+308
checkNumber(Number.MAX_VALUE * 2);  // "Process number as Infinity"
Try It Yourself

How It Works

Strict equality works because there is only one positive Infinity value.

Example 4 — Division by Zero

In JavaScript, 1 / 0 does not throw — it yields Infinity.

JavaScript
1 / 0;                                  // Infinity
1 / 0 === Number.POSITIVE_INFINITY;     // true
1 / Number.POSITIVE_INFINITY;           // 0
Try It Yourself

How It Works

IEEE-754 defines signed zeros: a positive finite divided by +∞ is +0.

Example 5 — Pair with isFinite()

Infinity is a number type, but it is not finite.

JavaScript
typeof Number.POSITIVE_INFINITY;                 // "number"
Number.isFinite(Number.POSITIVE_INFINITY);       // false
Number.POSITIVE_INFINITY > Number.MAX_VALUE;     // true
Try It Yourself

How It Works

Use Number.isFinite() when you need to reject Infinity, -Infinity, and NaN together.

🚀 Common Use Cases

  • Overflow detection — compare results to Number.POSITIVE_INFINITY.
  • Sentinel / clamp — some algorithms use ±Infinity as open bounds.
  • Graphics / physics — represent unbounded distances carefully.
  • Validation — reject non-finite inputs with Number.isFinite.
  • Not for errors by default — MDN notes NaN is often a better failure signal.
  • Teaching IEEE-754 — show that 1 / 0 is defined as Infinity in JS.

🧠 How Values Become POSITIVE_INFINITY

1

Start with finite math

Multiply, divide, or exponentiate toward huge magnitudes.

Input
2

Cross the finite ceiling

Past MAX_VALUE (or via 1 / 0), the engine cannot store a finite result.

Limit
3

Produce +Infinity

The result becomes Number.POSITIVE_INFINITY.

Result
4

Detect and handle

Compare, clamp, or reject with isFinite.

📝 Notes

  • This is a static property — use Number.POSITIVE_INFINITY only.
  • Do not write Number.POSITIVE_INFINITY() — it is not a function.
  • Number.POSITIVE_INFINITY === Infinity is true.
  • 0 * Infinity and Infinity / Infinity are NaN.
  • Negative twin: Number.NEGATIVE_INFINITY.
  • Prefer Number.isFinite() to reject all non-finite values.

Browser & Runtime Support

Number.POSITIVE_INFINITY is Baseline Widely available and supported in every modern browser and Node.js.

Baseline · Widely available

Number.POSITIVE_INFINITY

Safe for production everywhere. Same value as global Infinity, grouped under Number.

100% Universal support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
Number.POSITIVE_INFINITY Excellent

Bottom line: Use Number.POSITIVE_INFINITY to name positive infinity. Detect overflow with === or Number.isFinite. Remember MAX_VALUE is still finite.

Conclusion

Number.POSITIVE_INFINITY is the static constant for positive Infinity — the value you get from overflow and 1 / 0, identical to global Infinity.

Continue with MAX_VALUE, isFinite(), or the Number properties hub.

💡 Best Practices

✅ Do

  • Read Number.POSITIVE_INFINITY on the constructor
  • Compare with === when you mean exactly +∞
  • Use Number.isFinite(x) to reject Infinity and NaN
  • Guard multiplications that may overflow MAX_VALUE
  • Prefer the Number constant over relying on a writable global

❌ Don’t

  • Write (5).POSITIVE_INFINITY or call it as a function
  • Assume Infinity is “just a very large MAX_VALUE”
  • Ignore Infinity / Infinity becoming NaN
  • Use Infinity as a general error code when NaN fits better
  • Forget the negative twin NEGATIVE_INFINITY

Key Takeaways

Knowledge Unlocked

Five things to remember about Number.POSITIVE_INFINITY

Static name for IEEE-754 positive infinity.

5
Core concepts
02

Value

Infinity

Constant
🚀 03

Cause

overflow

Source
04

Check

isFinite

Validate
05

Mutable

no

Readonly

❓ Frequently Asked Questions

Number.POSITIVE_INFINITY is the positive Infinity value on Number. It is the same value as the global Infinity property. Example: Number.MAX_VALUE * 2 equals Number.POSITIVE_INFINITY.
Yes. Read it on Number itself: Number.POSITIVE_INFINITY. There is no (5).POSITIVE_INFINITY on number instances, and it is not a method.
Yes — Number.POSITIVE_INFINITY === Infinity is true. The Number. form keeps infinity with other Number constants. Number.POSITIVE_INFINITY is also non-writable.
Compare with Number.POSITIVE_INFINITY, or use Number.isFinite(x) which returns false for Infinity, -Infinity, and NaN. Prefer Number.isFinite over the global isFinite for no coercion.
Number.NEGATIVE_INFINITY is the negative Infinity value. -Number.POSITIVE_INFINITY equals Number.NEGATIVE_INFINITY.
It is Baseline Widely available and supported in every modern browser and Node.js.
Did you know?

In JavaScript, dividing by zero does not throw an exception for Numbers. 1 / 0 is Infinity, and -1 / 0 is -Infinity — matching IEEE-754, not school arithmetic that forbids division by zero.

More Number Properties

Return to the hub for static Number constants.

Number properties hub →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful