code: function sort(array, left, right, compare, swap) {
    if (left < right) {
      var pivot = partitionRandom(array, left, right, compare, swap);
      sort(array, left, pivot - 1, compare, swap);
      sort(array, pivot + 1, right, compare, swap);
    }
    return array;
  }
docs: Sorts an array using quicksort.
  @param {Array} array The array to sort.
  @param {number} left The index to sort from.
  @param {number} right The index to sort to.
  @param {function} compare The compare function.
  @param {function} swapObserver A function to call when the swap operation is
  performed. This can be used to listen in on internals of the algorithm.
  @returns The sorted array.