Array.prototype.indexOf = function(e){ for (var i = 0; i < this.length; i++) { if (e==this[i]) { return i; } } return -1; } Array.prototype.remove = function(elem) { var match = -1; while ((match = this.indexOf(elem)) > -1) { this.splice(match, 1); } };
No comments:
Post a Comment