Here you can find the source of removeItem(itemToRemove)
'use strict';//from ww w. ja va 2 s . c o m Array.prototype.removeItem = function (itemToRemove) { var index = this.indexOf(itemToRemove); var itemFoundInArray = (index != -1); if (itemFoundInArray) { this.splice(index, 1); // remove item at that index } };
Array.prototype.removeItem = function(item){ for (var i = 0; i < this.length; i++) { if (this[i] === item) { this.splice(i,1); i--; }; var arr = [1, 2, 1, 4, 1, 3, 4, 1, 111, 3, 2, 1, '1']; ...
Array.prototype.removeItem = function(item) { var index = this.indexOf(item); if(index > -1){ this.splice(index,1); return this; }; var arr = [1, 2, 1, 4, 1, 3, 4, 1, 111, 3, 2, 1, '1']; arr = arr.removeItem(1); ...
Array.prototype.removeItem = function (item) { var result = []; for (var i = 0; i < this.length; i++) { if (this[i] !== item) { result.push(this[i]); return result; }; ...
Array.prototype.removeItem = function(item) { for(var i = 0, l = this.length; i < l; ++i){ index = this.indexOf(item); if (index > -1) { this.splice(index, 1); return this;
Array.prototype.removeItem = function(item) { return this.remove(this.indexOf(item));
Array.prototype.removeItem = function(item_) { var i = this.indexOf(item_); this.splice(i, 1); };