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; }))
new Set 去重
arr.sort //排序
具体使用可参考手册:http://www.w3school.com.cn/js/jsref_sort.asp