code: function upperBound(value, arr) {
      let i = 0;
      let j = arr.length - 1;
      while (i < j) {
          const m = (i + j) >> 1;
          if (arr[m] > value) {
              j = m;
          } else {
              i = m + 1;
          }
      }
      return arr[i];
  }
docs: binary search for the first value in the array bigger than the given