先用sort 进行简单排序,再用reduce去重
let arr=[1,2,3,1,2,3,4,4,5,3,4,6];
let results=arr.sort().reduce((init,current)=>{
if(init.length==0||init[init.length-1]!=current){
init.push(current);
}
return init;
},[]); //设置current默认类型为数组,并且初始值为空的数组
console.log(results);