lensh / vue-qq

🎨 Vue family bucket with socket.io and express/koa2 , create a web version of mobile QQ, supporting real-time group chat, real-time private chat, special care, shielding chat, smart IP geographic location, real-time display temperature and other QQ core functions
MIT License
917 stars 230 forks source link

数组去重 #14

Open lensh opened 6 years ago

lensh commented 6 years ago

ES6实现: [...new Set([1,2,3,1,'a',1,'a'])]

ES5实现:

[1,2,3,1,'a',1,'a'].filter(function(ele,index,array){
    return index===array.indexOf(ele)
})