code: function updateNewIndices(slot, indexDelta) {
                      // If this slot is at the start of a sequence, transfer the indexNew
                      if (slot.firstInSequence) {
                          var indexNew;
  
                          if (indexDelta < 0) {
                              // The given slot is about to be removed
                              indexNew = slot.indexNew;
                              if (indexNew !== undefined) {
                                  delete slot.indexNew;
                              } else {
                                  indexNew = slot.index;
                              }
  
                              if (!slot.lastInSequence) {
                                  // Update the next slot now
                                  slot = slot.next;
                                  if (indexNew !== undefined) {
                                      slot.indexNew = indexNew;
                                  }
                              }
                          } else {
                              // The given slot was just inserted
                              if (!slot.lastInSequence) {
                                  var slotNext = slot.next;
  
                                  indexNew = slotNext.indexNew;
                                  if (indexNew !== undefined) {
                                      delete slotNext.indexNew;
                                  } else {
                                      indexNew = slotNext.index;
                                  }
  
                                  if (indexNew !== undefined) {
                                      slot.indexNew = indexNew;
                                  }
                              }
                          }
                      }
  
                      updateNewIndicesAfterSlot(slot, indexDelta);
                  }
docs: Updates the new index of the given slot if necessary, and all subsequent new indices