<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
<script>
var a=[1,2,3];
var b=new Array(2,5,6,8,74,85,5,22);
var c=b.concat(a);//两个数组合并
console.log(c);
var arr=c.sort();
arr.join();
Array.prototype.unique3 = function(){
var res = [];
var json = {};
for(var i = 0; i < this.length; i++){
if(!json[this[i]]){
res.push(this[i]);
json[this[i]] = 1;
}
}
return res;
}
console.log(arr.unique3());
</script>
</html>