使用JavaScript消除一个数组中重复的元素
var arr1 = [1,1,2,3,4,5,6,6,6,7],arr2 = [];
for(var i=0;i<arr1.length;i++){
if(arr2.indexof(arr1[i] < 0){
arr2.push(arr1[i]);
}
document.write(arr2); //1,2,3,4,5,6,7