What is Javascript Max Number?

Posted in Articles

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

Javascript has Number.MAX_VALUE which represents the maximum number that Javascript could represent.  This number is 1.7976931348623157e+308 which is what this program outputs…

Javascript MAX_VALUE

Javascript MAX_VALUE

This is a very big number.  e+308 is scientific notation for 10 raised to the 308 power.  It is 1 with 308 zeros after it.

The thing to note is that if you add 18 to Number.MAX_VALUE, you still get Number.MAX_VALUE.

But if you do Number.MAX_VALUE * 2 you get Infinity, which is a Javascript number type.  Go figure.