JS 去除重复元素的方法
2021-07-01 09:06
标签:efi code his return fine function 生活 pre cti 调用如下: @ JS 去除重复元素的方法 标签:efi code his return fine function 生活 pre cti 原文地址:http://www.cnblogs.com/chenwolong/p/7133445.htmlArray.prototype.del = function () {
var a = {}, c = [], l = this.length;
for (var i = 0; i ) {
var b = this[i];
var d = (typeof b) + b;
if (a[d] === undefined) {
c.push(b);
a[d] = 1;
}
}
return c;
}
var Ary = ["生活服务类", "健康保健类", "便民服务", "社区服务", "生活服务类", "健康保健类", "便民服务", "社区服务"]
Ary = Ary.del();
console.log(Ary);
上一篇:爬虫学习——网页解释器简介