var arr = [1,2,3,2,2,2,5,5,4,8,6,9,7]

arr =new Set(arr)
    console.log(arr)

 

 <script type="text/javascript">
        var arr = [1,2,3,2,2,2,5,5,4,8,6,9,7]

         arr =[...new Set(arr)]
        
    console.log(arr)
</script>    

  

 

posted on 2019-08-23 13:27  黑色领带结  阅读(91)  评论(0编辑  收藏  举报