scriptonia

Dec 27 '10

Javascript code snippet for removing item from array.

/*
  Snippet for removing value from javascript array.
*/
Array.prototype.remove = function() {
    var what, a = arguments, L = a.length, ax;
    while(L && this.length){
        what = a[--L];
        while((ax= this.indexOf(what))!= -1){
            this.splice(ax, 1);
        }
    }
    return this;
}

View comments Tags: javascript snippet

Blog comments powered by Disqus