Javascript Array removeAll(key)

Description

Javascript Array removeAll(key)

Array.prototype.removeAll = function(key){
    var index = this.indexOf(key);

    if(index === -1) return;

    this.splice(index, 1);/*from  ww  w.  ja v  a 2  s.  co  m*/
    this.removeAll(key);
};



PreviousNext

Related