Here you can find the source of remove(item)
Object.defineProperty(Object.prototype, "extend", { enumerable: false,//from w ww. j a va2 s . co m value: function(from) { var props = Object.getOwnPropertyNames(from); var dest = this; props.forEach(function(name) { // TODO: dlaczego 'in'? // if (name in dest) { var destination = Object.getOwnPropertyDescriptor(from, name); Object.defineProperty(dest, name, destination); // } }); return this; } }); Array.prototype.remove = function (item) { var index = this.indexOf(item); if (index !== -1) { this.splice(index, 1); } }; Array.prototype.contains = function (val) { return this.indexOf(val) !== -1; };
Array.prototype.remove = function(item) { var index; while ((index = this.indexOf(item)) !== -1) { this.splice(index, 1); return this; };
Array.prototype.remove = function(item){ var i = this.indexOf(item); return this.splice(i, 1);
Array.prototype.remove = function(item) { var index; index = this.indexOf(item); if (index >= 0) { return this.splice(index, 1)[0]; } else { return null; }; ...
Array.prototype.remove = function(item) { var items = [] if (arguments.length > 1) { items = arguments; } else { items = [item]; for (var i = 0; i < items.length; i++) { var index = this.indexOf(items[i]); ...
Array.prototype.remove = function(item) { for (var i = this.length; i--;) if (this[i] === item) this.splice(i, 1); return this; };
Array.prototype.remove = function(item){ var found = false; for(var i = 0; i < this.length; i++){ if (this[i] == item){ this.splice(i, 1); found = true; break; if (found == false){}
Array.prototype.remove = function (item) { var i; while((i = this.indexOf(item)) !== -1) { this.splice(i, 1); };
Array.prototype.remove = function (item) { var i = 0; while (i < this.length) { if (this[i] == item) { this.splice(i, 1); } else { i++; return this; };
Array.prototype.remove = function(item) { var newArray = []; if (this.indexOf(item) === -1) { return this; } else { for (var i = 0; i < this.length; i++) { if (this[i] !== item) { newArray.push(this[i]); return newArray; };