overwriteMarker = (marker, p, index) => {
  marker.p.marker = false;
  marker.p = p;
  p.marker = true;
  marker.index = index;
  marker.timestamp = globalSearchMarkerTimestamp++;
}
This is rather complex so this function is the only thing that should overwrite a marker

@param {ArraySearchMarker} marker
@param {Item} p
@param {number} index