删除数组中指定元素

//定义一个函数为删除数组中指定元素( 根据值删除不是位置 ) .remove("指定元素")使用
Array.prototype.remove = function(val) {
        var index = this.indexOf(val);
        if (index > -1) {
          this.splice(index, 1);
        }
};
指定数组.remove( 指定元素 )
this.formCustom.headPortrait.remove(removePicture);
posted @ 2019-12-17 13:34  写手在作画  阅读(826)  评论(0编辑  收藏  举报