JavaScript

JS Basics

JS Variables & Operators

JS Data Types & Conversion

JS Numbers & Math

JS Strings

JS Dates

JS Arrays

JS Control Flow

JS Loops & Iteration

JS Functions

JS Objects

JS Classes & Modules

JS Async Programming

JS Advanced

JS HTML DOM

JS BOM (Browser Object Model)

JS Web APIs

JS AJAX

JS JSON

JS Graphics & Charts

JavaScript

JS Basics

JS Variables & Operators

JS Data Types & Conversion

JS Numbers & Math

JS Strings

JS Dates

JS Arrays

JS Control Flow

JS Loops & Iteration

JS Functions

JS Objects

JS Classes & Modules

JS Async Programming

JS Advanced

JS HTML DOM

JS BOM (Browser Object Model)

JS Web APIs

JS AJAX

JS JSON

JS Graphics & Charts

JS Number Properties


📘 JavaScript Number Properties – Understanding Numeric Limits

The Number object in JavaScript contains several static properties that describe the limits, behavior, and special constants of the number system used in JS.

These properties belong to the global Number object and are not used on number variables.


🔹 Common Number Properties

Property Description
Number.MAX_VALUE Largest possible numeric value in JavaScript (~1.7976931348623157e+308)
Number.MIN_VALUE Smallest positive numeric value (~5e-324)
Number.MAX_SAFE_INTEGER Largest integer you can safely represent (2^53 - 1) = 9007199254740991
Number.MIN_SAFE_INTEGER Smallest safe integer = -9007199254740991
Number.POSITIVE_INFINITY Positive Infinity (1 / 0)
Number.NEGATIVE_INFINITY Negative Infinity (-1 / 0)
Number.NaN "Not-a-Number" value
Number.EPSILON Smallest difference between two representable numbers (~2.22e-16)

📌 Examples

Number.MAX_VALUE
console.log(Number.MAX_VALUE); 
// 1.7976931348623157e+308
Number.MIN_VALUE
console.log(Number.MIN_VALUE); 
// 5e-324
Number.MAX_SAFE_INTEGER
console.log(Number.MAX_SAFE_INTEGER); 
// 9007199254740991
Number.NaN
console.log(Number("hello")); 
// NaN
console.log(Number.NaN);      
// NaN
Number.POSITIVE_INFINITY and NEGATIVE_INFINITY
console.log(1 / 0);          
// Infinity
console.log(-1 / 0);         
// -Infinity
Number.EPSILON
console.log(Number.EPSILON); 
// 2.220446049250313e-16

Practice Questions

Q1. How do you print the largest number JavaScript can represent using a number property?

Q2. Which number property would you use to get the smallest possible positive value?

Q3. How do you access the maximum safe integer in JavaScript using a Number property?

Q4. What will Number("abc") return and which property represents it?

Q5. What is the value of 1 / 0 in JavaScript and which property does it relate to?

Q6. How do you check if a number exceeds Number.MAX_SAFE_INTEGER?

Q7. What is the output of console.log(Number.NEGATIVE_INFINITY)?

Q8. What does Number.EPSILON represent in floating-point calculations?

Q9. How do you access the minimum safe integer supported in JavaScript?

Q10. What is the difference between Number.NaN and isNaN() function?


JS Number Properties Quiz

Q1: What is the value of Number.MAX_SAFE_INTEGER?

A. 2147483647
B. 9007199254740991
C. Number.MAX_VALUE
D. Infinity

Q2: What does Number.MIN_VALUE represent?

A. Most negative number
B. Smallest positive number
C. 0
D. -Infinity

Q3: What is the result of Number("abc")?

A. 0
B. null
C. undefined
D. NaN

Q4: What does Number.POSITIVE_INFINITY represent?

A. null
B. -Infinity
C. Result of overflow or 1/0
D. undefined

Q5: Which of the following is true about Number.EPSILON?

A. It is the biggest number JS can handle
B. It is used to compare floating-point values
C. It is equal to zero
D. It returns NaN

Q6: Which Number property gives the lowest integer value that is still safe?

A. Number.MIN_INTEGER
B. Number.LOW_SAFE_INTEGER
C. Number.MIN_SAFE_INTEGER
D. Number.MIN_VALUE

Q7: What will console.log(Number.MAX_VALUE + 1) return?

A. Infinity
B. NaN
C. undefined
D. Error

Q8: What is the result of dividing any number by 0 in JavaScript?

A. NaN
B. 0
C. Infinity or -Infinity
D. undefined

Q9: What is the type of Number.NaN?

A. "NaN"
B. "undefined"
C. "object"
D. "number"

Q10: What will console.log(Number.EPSILON > 0) return?

A. false
B. true
C. undefined
D. NaN

Go Back Top