Javascript Array remove_value(value)

Description

Javascript Array remove_value(value)


/**//  w  w w.  j  a  va 2 s . c  o  m
 * Removes all entries with a specific value.
 * @param value
 */
Array.prototype.remove_value = function(value){
    var len = this.length,
        i;
    for(i = 0;i < len;i+=1){
        if(this[i] === value){
            this.splice(i,1);
            i-=1;
        }
    }
}



PreviousNext

Related