var a = ["2013-01","2013-01","2013-02","2013-02","2013-02","2013-03","2013-03"];
Array.prototype.del = function() {
var a = {}, c = [], l = this.length;
for (var i = 0; i < l; i++) {
var b = this[i];
var d = (typeof b) + b;
if (a[d] === undefined) {
c.push(b);
a[d] = 1;
}
}
return c;
}
alert(a.del());
时间: 2024-10-03 13:39:56