Node.js examples for Array:Remove Element
Removes all occurences of the given element from the list.
/**// ww w . ja va 2 s.c om * Removes all occurences of the given element from the list. * * @param element the element to remove. */ Array.prototype.removeAll = function(element) { for(var i=0; i<this.length; i++) { if(this[i] === element) { this.splice(i,1); i--; } } }