Nodejs Utililty Methods Array Remove Item

List of utility methods to do Array Remove Item

Description

The list of methods to do Array Remove Item are organized into topic(s).

Method

removeItem(item)
Array.prototype.removeItem = function(item) {
  return this.remove(this.indexOf(item));
removeItem(itemToRemove)
'use strict';
Array.prototype.removeItem = function (itemToRemove) {
  var index = this.indexOf(itemToRemove);
  var itemFoundInArray = (index != -1);
  if (itemFoundInArray) {
    this.splice(index, 1); 
};
removeItem(item_)
Array.prototype.removeItem = function(item_) {
    var i = this.indexOf(item_);
    this.splice(i, 1);
};