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
Fundamentals
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.
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).
Foundation
📝 Syntax
General form of the static property Number.POSITIVE_INFINITY:
JavaScript
Number.POSITIVE_INFINITY
Value
The same as the global Infinity property.
Property attributes
Attribute
Value
Writable
false
Enumerable
false
Configurable
false
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;
}
Cheat Sheet
⚡ Quick Reference
Goal
Code
Read positive Infinity
Number.POSITIVE_INFINITY
Negative Infinity
Number.NEGATIVE_INFINITY
Detect exactly +∞
x === Number.POSITIVE_INFINITY
Any non-finite?
!Number.isFinite(x)
Overflow past MAX_VALUE
Number.MAX_VALUE * 2
Divide by zero
1 / 0 → Infinity
Snapshot
🔍 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
Compare
📋 POSITIVE_INFINITY vs MAX_VALUE vs Infinity
POSITIVE_INFINITY
MAX_VALUE
global Infinity
Finite?
No
Yes
No (same value)
Magnitude
Special +∞
~1.8e+308
Same as POSITIVE_INFINITY
Identity
=== Infinity
Different
=== Number.POSITIVE_INFINITY
Writable on Number
No
No
Global may differ by env
Hands-On
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.
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"
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
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about Number.POSITIVE_INFINITY
Static name for IEEE-754 positive infinity.
5
Core concepts
🔢01
Kind
static
API
∞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.