同一个数组查重

let array=[1,2,5,4,1,2]
array.forEach((ele,index)=> {
          if(array.indexOf(ele) !== index){
           console.log(ele)
          }
        })
原文地址:https://www.cnblogs.com/wssdx/p/13362164.html