Javascript Array remove(what)
Array.prototype.remove = function(what) { var index = this.indexOf(what); if (index !== -1) { this.splice(this.indexOf(what), 1); }/*from ww w. java 2 s .c om*/ return this; }