es6數組排序去重

const array = [1,1,20,2,3,3,4,53,34] const array1 = [...new Set(array)] console.log(array1.sort((a, b)=>{ return a - b; }))html new Set   去重post arr.sort   //排序htm 具體使用可參考手冊:http://www.w3school.com.cn
相關文章
相關標籤/搜索