remove() {
        const nodes = this.nodes_;
        const count = nodes.length;
        const rootNode = nodes[0];
        if (count <= 0) {
            return undefined;
        } else if (count == 1) {  // eslint-disable-line
            nodes.length = 0;
        } else {
            nodes[0] = nodes.pop();
            if (nodes[0]) {
                nodes[0].index = 0;
            }
            this.moveDown_(0);
        }
        if (rootNode) {
            delete rootNode.index;
        }
        return rootNode;
    }
Retrieves and removes the root value of this heap.
@return {Node} The root node item removed from the root of the heap. Returns
    undefined if the heap is empty.