标签:strong pre asc str type 元素 rip function for
Array.prototype.indexOf = function (val) {
for(var i = 0; i < this.length; i++){
if(this[i] == val){return i;}
}
return -1;
}
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if(index > -1){this.splice(index,1);}
}
var temp = [1,5,6,12,453,324]; temp.remove(12);//测试OK
标签:strong pre asc str type 元素 rip function for
原文地址:https://www.cnblogs.com/yu412/p/12711905.html