js代码:
<script type="text/javascript">
var arr=[12,5,2,3,8,8,5,6,1,0];
var arr1=[];
function quchong(arr){
for(var i=0;i<arr.length;i++){
if(arr1.indexOf(arr[i])==-1){
arr1.push(arr[i]);
};
};
//return arr1;
alert(arr1);
}
window.onload=function(){
quchong(arr);
}
</script>