-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
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 Functions
Function Definitions
Function Parameters
Function Invocation
Function Call
Function Apply
Function Bind
Function Closures
JS Arrow Function
JS Objects
JS Objects
JS Object Properties
JS Object Methods
JS Object Display
JS Object Constructors
Object Definitions
Object Get / Set
Object Prototypes
Object Protection
JS Classes & Modules
JS Async Programming
JS Advanced
JS Destructuring
JS Bitwise
JS RegExp
JS Precedence
JS Errors
JS Scope
JS Hoisting
JS Strict Mode
JS this Keyword
JS HTML DOM
DOM Intro
DOM Methods
DOM Document
DOM Elements
DOM HTML
DOM Forms
DOM CSS
DOM Animations
DOM Events
DOM Event Listener
DOM Navigation
DOM Nodes
DOM Collections
DOM Node Lists
JS BOM (Browser Object Model)
JS Window
JS Screen
JS Location
JS History
JS Navigator
JS Popup Alert
JS Timing
JS Cookies
Web Storage API
JS Web APIs
JS AJAX
AJAX Intro
AJAX XMLHttp
AJAX Request
AJAX Response
AJAX XML File
AJAX PHP
AJAX ASP
AJAX Database
AJAX Applications
AJAX Examples
JS JSON
JSON Intro
JSON Syntax
JSON vs XML
JSON Data Types
JSON Parse
JSON Stringify
JSON Objects
JSON Arrays
JSON Server
JSON PHP
JSON HTML
JSON JSONP
JS Canvas
JS Graphics & Charts
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 Functions
Function Definitions
Function Parameters
Function Invocation
Function Call
Function Apply
Function Bind
Function Closures
JS Arrow Function
JS Objects
JS Objects
JS Object Properties
JS Object Methods
JS Object Display
JS Object Constructors
Object Definitions
Object Get / Set
Object Prototypes
Object Protection
JS Classes & Modules
JS Async Programming
JS Advanced
JS Destructuring
JS Bitwise
JS RegExp
JS Precedence
JS Errors
JS Scope
JS Hoisting
JS Strict Mode
JS this Keyword
JS HTML DOM
DOM Intro
DOM Methods
DOM Document
DOM Elements
DOM HTML
DOM Forms
DOM CSS
DOM Animations
DOM Events
DOM Event Listener
DOM Navigation
DOM Nodes
DOM Collections
DOM Node Lists
JS BOM (Browser Object Model)
JS Window
JS Screen
JS Location
JS History
JS Navigator
JS Popup Alert
JS Timing
JS Cookies
Web Storage API
JS Web APIs
JS AJAX
AJAX Intro
AJAX XMLHttp
AJAX Request
AJAX Response
AJAX XML File
AJAX PHP
AJAX ASP
AJAX Database
AJAX Applications
AJAX Examples
JS JSON
JSON Intro
JSON Syntax
JSON vs XML
JSON Data Types
JSON Parse
JSON Stringify
JSON Objects
JSON Arrays
JSON Server
JSON PHP
JSON HTML
JSON JSONP
JS Canvas
JS Graphics & Charts
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.
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 ) |
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
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?
Q1: What is the value of Number.MAX_SAFE_INTEGER?
Q2: What does Number.MIN_VALUE represent?
Q3: What is the result of Number("abc")?
Q4: What does Number.POSITIVE_INFINITY represent?
Q5: Which of the following is true about Number.EPSILON?
Q6: Which Number property gives the lowest integer value that is still safe?
Q7: What will console.log(Number.MAX_VALUE + 1) return?
Q8: What is the result of dividing any number by 0 in JavaScript?
Q9: What is the type of Number.NaN?
Q10: What will console.log(Number.EPSILON > 0) return?