JS去重 + Python去重

1 var arr1 = [1,2,3,3,4,4,5,6],
2     arr2 = [];
3 for(var i=0; i < arr1.length; i++){
4     if(arr2.indexof(arr1[i]) < 0{
5         arr2.push(arr1[i]);
6     }
7 }
8 
9 document.write(arr2);

 

l1 = []
l2 = list(set(l1))

 

posted @ 2020-04-23 23:01  燕十三丶  阅读(126)  评论(0编辑  收藏  举报
AmazingCounters.com