
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
What is negative infinity in javascript?
The Number.NEGATIVE_INFINITY property represents the negative Infinity value. Any value that goes over the maximum value is available in JavaScript gets changed to negative infinity.
Example
function checkInfinity(smallNumber) { if (smallNumber === Number.NEGATIVE_INFINITY) { return 'Process number as -Infinity'; } return smallNumber; } console.log(checkInfinity(-Number.MAX_VALUE)); console.log(checkInfinity(-Number.MAX_VALUE * 2));
Output
-1.7976931348623157e+308 "Process number as -Infinity"
You can find more details about how this number is processed in javascript at MDN docs:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY
Note − The value of Number.NEGATIVE_INFINITY is the same as the negative value of the global object's Infinity property.
- Related Articles
- How to print positive and negative infinity values in JavaScript?
- What is infinity?
- Test element-wise for positive or negative infinity in Numpy
- Test array values for positive or negative infinity in Numpy
- How Is Infinity converted to Number in JavaScript?
- How -Infinity is converted to Number in JavaScript?
- How -Infinity is converted to String in JavaScript?
- How -Infinity is converted to Boolean in JavaScript?
- How Is Infinity converted to Boolean in JavaScript?
- How Is Infinity converted to String in JavaScript?
- JavaScript Infinity Property
- How to find the value closest to negative infinity in Python?
- Replace NaN with zero and fill negative infinity values in Python
- NaN and Infinity example in JavaScript
- Return the negative infinity Norm of the matrix in Linear Algebra in Python

Advertisements