TIL: `Number.MAX_SAFE_INTEGER` is 2**53 - 1

I was filling out a form today and a friend joked, “You should put Number.MAX_SAFE_INTEGER in the budget field.” Woah! I didn’t know we had that constant. Number.MAX_SAFE_INTEGER was added to JavaScript in 2015 as part of ES6. The constant is new to me, but the value is a number I know by heart: 2**53 - 1. When I worked at Twitter, we switched from 32-bit IDs generated by MySQL to 64-bit IDs…