Here you can find the source of remove(item)
Array.prototype.remove = function(item) { var p = this.indexOf(item); if(p != -1)//ww w . ja va 2 s. c o m this.splice(p,1); };
Object.defineProperty(Object.prototype, "extend", { enumerable: false, value: function(from) { var props = Object.getOwnPropertyNames(from); var dest = this; props.forEach(function(name) { var destination = Object.getOwnPropertyDescriptor(from, name); Object.defineProperty(dest, name, destination); }); ...
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; };
Array.prototype.remove = function(item){ if (this.contains(item)) return this.splice(this.indexOf(item), 1);
Array.prototype.remove = function (itemToRemove) { var i, len = this.length; for (i = 0; i < len; i += 1) { if (this[i] === itemToRemove) { this.splice(i, 1); }; ...
Array.prototype.remove = function(num) { this[num] = null; return this; };
var arr = [1, 2, 1, 4, 1, 3, 4, 1, 111, 3, 2, 1, '1']; Array.prototype.remove = function(numToRemove) { var i; for (i = 0; i < this.length; i++) { if (this[i] === numToRemove) { this.splice(i, 1); i--; }; arr.remove(1); console.log(arr);