Nodejs Utililty Methods Array Remove All

List of utility methods to do Array Remove All

Description

The list of methods to do Array Remove All are organized into topic(s).

Method

removeAll(predicate)
Array.prototype.removeAll = function (predicate) {
  var item;
  var i = 0;
  while ((item = this.first(predicate)) != null) {
    i++;
    this.remove(item);
  return i;
};
...
removeAllOccurences(el)
Array.prototype.removeAllOccurences = function(el) {
  var foundOne = false;
  while (this.remove(el)) {
    foundOne = true;
  return foundOne;
};