Hello Everyone, I am new here and I want to know about NEGATIVE_INFINITY in JavaScript. I am learning javascript and I have one doubt NEGATIVE_INFINITY is a static property in JS that results? Can anyone know about it? I am preparing some javascript interview topics, Can anyone suggest me?
It is a static property of Number.
Here is a pretty good post about it: https://dmitripavlutin.com/infinity-in-javascript/
Cheers,
Bob
Negative infinity is something that is lower than any other number . This means that no other number is lesser than this value. In JavaScript negative infinity is a constant value which is used to represent a value which is the lowest available .
var x = 500;
x.NEGATIVE_INFINITY;
returned "undefined"
This works great in JavaScript because any value compared to Math.NEGATIVE_INFINITY will be greater.
In other languages like C++, it’s common to use the minimum value of an integer, float, etc.