javascript从数组中删除一个元素

Array.prototype.remove = function(val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};

pubArray.remove(pubArray[i]);

posted on 2015-04-30 14:43  lyming  阅读(592)  评论(0编辑  收藏  举报