js filter 数组去重

1       let arr = [1, 2, 3, 10, 4, 5, 1, 3, 5];
2       let stateNumArr = arr.filter((item, index, array) => {
3         return array.indexOf(item) === index;
4       });
5       console.log(stateNumArr);

 

posted @ 2018-07-30 11:17  raunds  阅读(707)  评论(0编辑  收藏  举报