I recently came across Number.MAX_SAFE_INTEGER and Number.isSafeInteger()
I’ve looked online for something to explain WHY these properties of Number are used and what function they would serve. I can’t find anything that really gets across to me.
Can someone break this down and explain it’s necessity, it’s function to me?
MAX_SAFE_INTEGER is a constant value that presents an integer value that the browser can realistic achieve without losing precision. If you want more information about this value, you are stepping into computer science realm where you have to deal with JavaScript specification.
Is to test the limits of your program for whatever reason that you need numbers higher than the specification allows. This is important to know because if you need precision higher that 2^52 - 1. Then you’ll have to figure another way around this limitation.