finds array item that equals to given value and removes it returns removed value
173290
function pullByValue(arr, value) {
    for (let i = 0; i < arr.length; i++) {
        if (arr[i] === value) {
            shift(arr, i);
            return value;
        }
    }

    return undefined;
}
483173
function (items, options) {
            var removed = [];

            if (!_.isArray(items)) {
                items = [items];
            }
            var item;
            for (var i = 0; i < items.length; i++) {
                item = this.removeAt(this.indexOf(items[i]), options);
                item && removed.push(item);
            }
            return removed;
        }
865277
function arrayIndexOfComparer(array, item, comparer) {
    for (var i = 0, len = array.length; i < len; i++) {
      if (comparer(array[i], item)) { return i; }
    }
    return -1;
  }
974174
function removeKeyFromList(list, key, value) {
    for (var i = list.length - 1; i >= 0; i--) {
        if (list[i][key] == value) {
            return list.splice(i, 1); // remove from array
        }
    }
    return false;
}
1363296
function (items, array, index) {
        
        // There might be some optimization to be made here.
        // Right now, I'm just going for a simple solution.
        
        if (   !(items instanceof Array)
            || !(array instanceof Array) )
            throw "IllegalArgumentException: items and array must both be Array objects.";
        
        var numRemoved = 0;
        for (var i = 0, len = items.length; i < len; i++) {
            if (Arrays.remove(items[i], array, index) >= 0)
                numRemoved++;
        }
        
        return numRemoved;
    }
143372
function(item, dontPushVal, options) {
      var self = this;

      if (self.objectItems) {
        if (typeof item === "object")
          item = $.grep(self.itemsArray, function(other) { return self.options.itemValue(other) ==  self.options.itemValue(item); } );
        else
          item = $.grep(self.itemsArray, function(other) { return self.options.itemValue(other) ==  item; } );

        item = item[item.length-1];
      }

      if (item) {
        var beforeItemRemoveEvent = $.Event('beforeItemRemove', { item: item, cancel: false, options: options });
        self.$element.trigger(beforeItemRemoveEvent);
        if (beforeItemRemoveEvent.cancel)
          return;

        $('.tag', self.$container).filter(function() { return $(this).data('item') === item; }).remove();
        $('option', self.$element).filter(function() { return $(this).data('item') === item; }).remove();
        if($.inArray(item, self.itemsArray) !== -1)
          self.itemsArray.splice($.inArray(item, self.itemsArray), 1);
      }

      if (!dontPushVal)
        self.pushVal(self.options.triggerChange);

      // Remove class when reached maxTags
      if (self.options.maxTags > self.itemsArray.length)
        self.$container.removeClass('bootstrap-tagsinput-max');

      self.$element.trigger($.Event('itemRemoved',  { item: item, options: options }));
    }
1207815
function(recentEntryArray, value) {
			var indexOfElement = -1;
			
			recentEntryArray.some(function(entry, index){
				if (entry.value === value) {
					indexOfElement = index;
					return true;
				}
				return false;
			});
			
			return indexOfElement;
		}
503714
function (array, item) {
      var idx = indexOf(array, item);
      if (idx === -1) { return null; }

      return array[idx + 1];
    }
1148968
public static function removeByValue($array, $value): array
    {
        if (! Assert::array($array)) {
            throw new InvalidArgumentException(
                '`Arr::removeByValue` first parameter must be `array` or implements interface `ArrayAccess`'
            );
        }

        foreach ($array as $i => $val) {
            if (trim($val) === trim($value)) {
                unset($array[$i]);
            }
        }

        return $array;
    }
1270100
def remove_value(v)
      index = @values.index(v)
      if index
        return !@values.delete_at(index).nil?
      else
        return false
      end
    end
365244
function arrayEach$1(array, iteratee) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (iteratee(array[index], index, array) === false) {
      break;
    }
  }
  return array;
}
1225604
def __find_and_remove_value(list, compare):
    """"""
    # next throws if there are no matches
    try:
        found = next(value for value in list
                     if value['name'] == compare['name'] and value['switch'] ==
                     compare['switch'])
    except:
        return None

    list.remove(found)

    return found
937618
public function remove()
    {

        $removed = 0;
        foreach( func_get_args() as $arg ){

            // is this a container?
            if( $arg instanceof Container ) {

                $originalCount = $this->count();
                $this->collection = array_diff_key( $this->collection, $arg->collection );
                $removed += ( $originalCount - $this->count() );

            } else {

                // use array search
                $search = $this->search( $arg, true );

                foreach( $search as $value ){
                    if( $value !== false ){
                        $removed++;
                        $this->offsetUnset( $value );
                    }
                }

            }

        }
        $this->rewind();
        return $removed;

    }
1053758
function removeItemsFromList(list, itemsToRemove) {
    var result = [];

    _.each(list, function (item) {
        var valid = true;
        for (var i = 0; i < itemsToRemove.length; i++) {

            // if the item match one of the items to remove don't includ it in the result list
            if (item.indexOf(itemsToRemove[i]) === 0) {
                valid = false;
                break;
            }
        }

        if (valid) {
            result.push(item);
        }
    });

    return result;
}
1176965
def remove_item(self, item):
        
        for idx, _item in enumerate(self.items):
            if item == _item:
                del self.items[idx]
                return True
        return False
402897
function _trim($value)
    {
        for ($i = count($value) - 1; $i >= 0; --$i) {
            if ($value[$i]) {
                break;
            }
            unset($value[$i]);
        }

        return $value;
    }
294380
function findValue (arr, value) {
	value = purifyValue(value);

	for (var i = arr.length - 1; i >= 0; i--) {
		if (arr[i].val === value) {
			return arr[i].pos;
		};

		if (i === 0) {
			return -1;
		};
	};
}