This excellent, highly recommended javascript tutorial, by Ilya Kantor, shares the following:
// Hello! I'm a self-increasing number!
console.log( 9999999999999999 ); // shows 10000000000000000
I don't get why 9,999,999,999,999,999 is turned into 10,000,000,000,000,000. If we have 53 bits to store a number (out of the 64), given that representing the number above requires more bits than available (precisely 54 ?), why not return all the 53 bits we have oned, meaning we are representing the maximum number we possibly can (9,007,199,254,740,991) ?
The post here mentions 52 bits to store a number out of the 64, but I changed it to 53 after checking Number.MAX_SAFE_INTEGER and putting it into Window's calculator in programming mode - it gives 53 bits oned.