Javascript Array removeItem(str)

Description

Javascript Array removeItem(str)


Array.prototype.removeItem = function(str) {
   for( i = 0; i < this.length ; i++)
   {/*from   w  w  w .  j ava  2s  .c  om*/
     if(escape(this[i]).match(escape(str.trim()))){
       this.splice(i, 1);  break;
     }
   }
  return this;
}



PreviousNext

Related