code: function heapUp(i) {
      var w = heapWeight(i)
      while(i > 0) {
        var parent = heapParent(i)
        if(parent >= 0) {
          var pw = heapWeight(parent)
          if(w < pw) {
            heapSwap(i, parent)
            i = parent
            continue
          }
        }
        return i
      }
    }
docs: Bubbles element i up the heap