Javascript Array delete_if(matcher)

Description

Javascript Array delete_if(matcher)


Array.prototype.delete_if = function(matcher){
  for(var i = 0; i < this.length; i++){
    if(matcher(this[i])) {
      this.delete_at(i)//from   ww w. j  av  a2s . c  o  m
      i--
    }
  }
}



PreviousNext

Related