const mid = Math.floor((right + left) / 2);
susceptible to overflow?
EDIT: Hm, perhaps not (in JS). Number.MAX_SAFE_INTEGER is much greater than I expected.
https://ai.googleblog.com/2006/06/extra-extra-read-all-about...
mid = (lo + hi) >>> 1
EDIT: legibility
const mid = Math.floor(left + (right - left) / 2);
https://stackoverflow.com/q/27167943
const mid = Math.floor((right + left) / 2);
susceptible to overflow?
EDIT: Hm, perhaps not (in JS). Number.MAX_SAFE_INTEGER is much greater than I expected.