remove(index = 0) {
    if (!this.size) return null;
    this.swap(index, this.size - 1); // swap with last
    const value = this.array.pop(); // remove element
    this.bubbleDown(index);
    return value;
  }
Retrieves and removes the head of this heap, or returns null if this heap is empty.
@runtime O(log n)