reverse() {
    const originalCompareFn = this.compare;
    this.compare = (a, b) => originalCompareFn(b, a);
  }
Reverse the comparison function to use the opposite logic, e.g:
this.compare(a, b) => 1
this.reverse();
this.compare(a, b) => -1