Replace `Math.pow(2, 53) - 1` with `Number.MAX_SAFE_INTEGER`? Or at least extract it out of the function.