poll() {
        if (this.isEmpty()) {
            throw new Error("Heap is empty.");
        }

        /*
         * If there are at least two items in the array, then we need to do a
         * remove and rebalance operation to ensure the heap remains consistent.
         */
        if (this[array].length > 1) {

            // first remove the top value for safe keeping
            const topValue = this[array][0];

            /*
             * Next, take the last item from the array and move it into the top
             * slot. This will likely not be the correct value but maintains the
             * tree hierarchy. Then, reorganize the heap so it remains properly
             * ordered.
             */
            const replacementValue = this[array].pop();
            this[array][0] = replacementValue;
            heapifyDown(this[array], this[compare]);

            // finally, return the value
            return topValue;
        } else {

            /*
             * In this case, the array has only one item, so it's simpler to just
             * pop the value off of the array and return it.
             */
            return this[array].pop();
        }
        
    }
Returns and removes the value at the top of the heap.
@returns {*} The value at the top of the heap.