extend(values) {
        for (const value of values) {
            if (this.size < this._maxSize) {
                this._heap.push(value);
                this._siftUp();
            } else {
                // Get index of value with the lowest priority
                const smallest = this._smallest();

                // If the new value has higher priority than the smallest value in the heap
                // then replace the smallest value with the new value and update the heap
                if (this._comparator(value, this._heap[smallest])) {
                    this._heap[smallest] = value;
                    this._siftUpFrom(smallest);
                }
            }
        }
        return this.size;
    }
Add multiple elements to the queue.
@param {any[]} values The values to push into the queue.
@returns {number} The new size of the queue.