Nodejs Array Remove All removeAllOccurences(el)

Here you can find the source of removeAllOccurences(el)

Method Source Code

Array.prototype.removeAllOccurences = function(el) {
   var foundOne = false;
   while (this.remove(el)) {
      foundOne = true;// w  w w . ja v a2s .c om
   }
   return foundOne;
};

Related

  1. removeAll(elements)
    Array.prototype.removeAll = function(elements) {
      for (var i = 0; i < elements.length; i++) {
        this.remove(elements[i]);
    };
    
  2. removeAll(item)
    Array.prototype.removeAll = function (item) {
      var removed = []
      for (var i = 0, x = this.length; i < x; i++) {
        if (this[i] === item) {
          removed.push(item)
          this.splice(i, 1)
          i--
      return removed
    var colors = ['red', 'red', 'yellow', 'red']
    for (p in colors) {
      console.log(p)
    
  3. removeAll(items)
    Array.prototype.removeAll = function(items){
      for (var i=0; i<items.length; i++){
        this.remove(items[i]);
      return true;
    
  4. removeAll(obj)
    Array.prototype.removeAll = function(obj) {
      var newArr = new Array();
      var len = this.length;
      for(var i = 0; i < len; i++) {
        if(this[i] != obj)
          newArr.push(this[i]);
      this = newArr;
      return this;
    ...
    
  5. removeAll(predicate)
    Array.prototype.removeAll = function (predicate) {
      var item;
      var i = 0;
      while ((item = this.first(predicate)) != null) {
        i++;
        this.remove(item);
      return i;
    };
    ...