function remove(arr){
var newarr=[];
var obj={};
for(var i=0;i < arr.length;i++){
if(!obj[arr[i]]){
newarr.push(arr[i]);
obj[arr[i]]=1;
}
}
return newarr;
}
function sortt(a,b){
return a-b;//a-b 是以升序排列 b-a是以降序排列
}
var a=[1,1,2,5,3,6,7,33,45,22,122,22,44,2,5,55];
var result=remov(a);
console.log(result.sort(sortt));