Array.prototype.uniqueZcjgData = function() {
var o = new Object();
for ( var i = 0, j = 0; i < this.length; i++) {
if (typeof o[this[i]] == 'undefined') {
o[this[i]] = j++;
}
}
this.length = 0;
for ( var key in o) {
this[o[key]] = key;
}
return this;
};
js 数组扩展元素去重的方法
最新推荐文章于 2024-04-12 03:35:25 发布