var a=[1,2,3,3,3,3,3,2,2,];
Array.prototype.unique1 = function()
{
var n = []; //一个新的临时数组
for(var i = 0; i < this.length; i++) //遍历当前数组
{
if (n.indexOf(this[i]) == -1) n.push(this[i]);
//--------------------- 这句话怎么理解-------------------------------------
}
return n;
}
console.log(a.unique1());依韵_宵音
慕粉4084382
慕的地6079101
欧罗巴皇
落叶1111
清风流光
侠客中的王者
啊啊啊啊123
tom的猫
相关分类