Replace array element at given index with new item.
Doesn't modify source array.
@param {Array} items
@param {*} item
@param {Number} index
@return {Array}
181309
function replaceAt(items, item, index) {
  var copy = items.slice();
  copy.splice(index, 1, item);
  return copy;
}
48923
function (index, options) {
            options = options || {};

            if (index > -1 && index < this.$items.length) {
                var items = this.$items.splice(index, 1),
                    item = items[0];

                if (options.silent !== true) {
                    this.trigger('remove', {item: item, index: index});
                }
                if (item instanceof Bindable) {
                    item.unbind('*', this._onItemEvent, this);
                    item.unbind('change', this._onItemChange, this);
                }
                return items[0];
            }
            return null;
        }
295455
def insert(self, index, x):
        
        self.check_insertion(x)

        self.real_list.insert(index, x)
        self._items |= {x}
246747
function (item, index) {
            var component = this._createComponentForItem(item, index);
            this._cacheComponentForItem(item, component);
            this._innerAddChild(component, index);
        }
388417
function findIndex (array, item) {
  return array
    .map(function (i) {
      return i.toLowerCase()
    })
    .indexOf(item.toLowerCase())
}
713854
function (item) {
    var i = this.indexOf(item);
    if (!~i) return false;
    this.source.splice(i, 1);
    this._updateInfo();

    this.emit("remove", item, i);
    this.emit("update", { remove: [item] });
    return item;
  }
235315
function(item, index) {
                var n = this.length,
                        i = index == null ? n - 1 : index
                if (i < 0)
                    i = Math.max(0, n + i)
                for (; i >= 0; i--)
                    if (this[i] === item)
                        return i
                return -1
            }
318756
function (array, pred) {
      for (var idx = 0, len = array.length; idx < len; idx ++) {
        var item = array[idx];
        if (pred(item)) {
          return item;
        }
      }
    }
94820
static int[] insert(int[] itemset, int item) {
        if (itemset == null) {
            int[] newItemset = {item};
            return newItemset;
            
        } else {
            int n = itemset.length + 1;
            int[] newItemset = new int[n];

            newItemset[0] = item;
            System.arraycopy(itemset, 0, newItemset, 1, n - 1);

            return newItemset;
        }
    }
1134043
function (/* items... */) {
		var items = slice(arguments);
		var item;
		for (var i = 0, l = items.length; i < l; i++) {
			item = items[i];
			$Array.push.call(this, item);
			this.trigger(EVENT_ADD, item, this.length);
		}
		return this.length;
	}
648683
function (start/*, items... */) {
		var items = slice(arguments, 1);
		var item, index;
		for (var i = 0, l = items.length; i < l; i++) {
			item = items[i];
			index = start + i;
			$Array.splice.call(this, index, 0, item);
			this.trigger(EVENT_ADD, item, index);
		}
		return this.length;
	}
753134
function (items) {
        var self = this;

        // Force single item into array
        if (!Tools.isArray(items)) {
          if (items instanceof Collection) {
            self.add(items.toArray());
          } else {
            push.call(self, items);
          }
        } else {
          push.apply(self, items);
        }

        return self;
      }
27790
private void replaceItems(Map<String, String> items) {

        String oldValue = m_selectBox.getFormValueAsString();
        //set value and option to the combo box.
        m_selectBox.setItems(items);
        if (items.containsKey(oldValue)) {
            m_selectBox.setFormValueAsString(oldValue);
        }
    }
342033
function add(item, index) {
      if (!item) return -1;

      if (!angular.isNumber(index)) {
        index = _items.length;
      }

      _items.splice(index, 0, item);

      return indexOf(item);
    }
500000
function(item) {
        var id = item.id || item;

        var removedItem;
        var index = Selectivity.findIndexById(this._data, id);
        if (index > -1) {
            removedItem = this._data[index];
            this._data.splice(index, 1);
        }

        if (this._value[index] !== id) {
            index = this._value.indexOf(id);
        }
        if (index > -1) {
            this._value.splice(index, 1);
        }

        if (removedItem) {
            this.triggerChange({ removed: removedItem });
        }

        if (id === this._highlightedItemId) {
            this._highlightedItemId = null;
        }

        this._updateInputWidth();
    }
975216
function(items) {
            items = $.makeArray(items);

            for (var i = 0; i < items.length; i++) {
                var item = items[i];

                // Make sure we actually know about this item
                var index = $.inArray(item, this.$items);
                if (index !== -1) {
                    this._deinitItem(item);
                    this.$items.splice(index, 1);
                }
            }
        }
1043938
function(new_indices) {

		var i = 0,
			result = this._createHelperStorage(),
			index,
			verification = {};

		if (Lava.schema.DEBUG && new_indices.length != this._count) throw "reorder: new item count is less than current";

		for (; i < this._count; i++) {

			index = new_indices[i];
			result.push(this._data_uids[index], this._data_values[index], this._data_names[index]);

			if (Lava.schema.DEBUG) {
				// duplicate UIDs may break a lot of functionality, in this class and outside
				if (index in verification) Lava.t("Malformed index array");
				verification[index] = null;
			}

		}

		this._assignStorage(result);
		this._fire('collection_changed');

	}