删除数组中指定元素

//定义一个函数为删除数组中指定元素( 根据值删除不是位置 ) .remove("指定元素")使用
Array.prototype.remove = function(val) {
        var index = this.indexOf(val);
        if (index > -1) {
          this.splice(index, 1);
        }
};
指定数组.remove( 指定元素 )
this.formCustom.headPortrait.remove(removePicture);

猜你喜欢

转载自www.cnblogs.com/home-/p/12054032.html