code: function searchAround (
      getValue, getConditionValue, value, conditionValue, i, arr
    ) {
      var start = i;
      var elm = arr[i];
  
      while (elm && (
        getValue(elm) !== value || getConditionValue(elm) !== conditionValue)
      ) {
        elm = arr[--i];
      }
  
      if (!elm || getValue(elm) !== value) {
        i = Math.min(arr.length, start + 1);
        elm = arr[i];
      }
  
      while (elm && (
        getValue(elm) !== value || getConditionValue(elm) !== conditionValue)
      ) {
        elm = arr[++i];
      }
  
      if (!elm || getValue(elm) !== value) {
        return -1;
      }
  
      return i;
    }
docs: Searches all elements around `i` in `arr` that statisfy `conditionValue(elem) === conditionValue`. This will return and index such that `getValue(arr[i]) === value` or -1 if none can be found.