code: function makeAscendingRun(array, lo, hi, compare) {
    let runHi = lo + 1;
  
    if (runHi === hi) {
      return 1;
    }
  
    // Descending
    if (compare(array[runHi++], array[lo]) < 0) {
      while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
        runHi++;
      }
  
      reverseRun(array, lo, runHi);
      // Ascending
    } else {
      while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {
        runHi++;
      }
    }
  
    return runHi - lo;
  }
docs: Counts the length of a monotonically ascending or strictly monotonically
  descending sequence (run) starting at array[lo] in the range [lo, hi). If
  the run is descending it is made ascending.
  
  @param {array} array - The array to reverse.
  @param {number} lo - First element in the range (inclusive).
  @param {number} hi - Last element in the range.
  @param {function} compare - Item comparison function.
  @return {number} - The length of the run.