Javascript Array removeAll(predicate)
Array.prototype.removeAll = function (predicate) { var item;/*from w w w. j a v a2 s. c o m*/ var i = 0; while ((item = this.first(predicate)) != null) { i++; this.remove(item); } return i; };