给Array增加一个remove方法
代码如下:
Array.prototype.remove = function (fn) { for (var i = this.length - 1; i > -1; i--) { if (fn(this[i])) this.splice(i, 1) } }