๐ขInfinity
- JS โฉ scope โฉ global โฉ global object โฉ property โฉ Infinity 
( global object property )โ
- a property of the global object. (that is, a variable in global scope). 
- initial value of Infinity is Number.POSITIVE_INFINITY. 
- Infinity is greater than any other number. 
๐ฏ synonyms๏ผ "positive infinity"
Infinity
- division by zero yields ยฑInfinity (no error)โ 
- converts to 0 when used as operands of bitwise operator. 
- ๐ NaN - not a number. 
- โ ๏ธdivision (/) may result in Infinityโ 
- replit - JS: ยฑInfinity & ยฑ0 
const M = Number.MAX_VALUE;     // = 1.7976931348623157e+308 โ 2ยนโฐยฒโด
const D = Math.pow(2, 970);     // 2โนโทโฐ
const d = Math.pow(2, 969);     // 2โนโถโน
// -------- Infinity --------
 1 / 0,     //  Infinity
-1 / 0,     // -Infinity
 Infinity === Number.POSITIVE_INFINITY, // true
-Infinity === Number.NEGATIVE_INFINITY, // true
3 + Infinity,           // Infinity
3 / Infinity,           //  0
-3 / Infinity,          // -0
Infinity / Infinity,    // NaN
// -------- Number.MAX_VALUE --------
M,                      // 1.7976931348623157e+308
// โญ๏ธ ๅช่ฆ M ็ๆๅพไธไฝ (2โนโทยน) ็ไธๅ = 2โนโทโฐ ๅฐฑ่ถณไปฅ่ฎ M ใ้ฒไฝใ่ฎๆ Infinity
M + D,                  // Infinity
// โญ๏ธ ๅๅฐ็่ฉฑ๏ผๅๆ่ขซ็ดๆฅใๆจๆฃใใ
M + d,                  // M
// -------- Number.MAX_SAFE_INTEGER --------
Number.MAX_SAFE_INTEGER,    // 9007199254740991 = 2โตยณ - 1
Math.pow(2, 53) - 1,        // 9007199254740991Last updated
Was this helpful?