var arr =[1,1,2,2,2,3,4,5,5]functionRemoveRepetition_1(arr){for(var i=0;i<arr.length;i++){if(arr.indexOf(arr[i])!==i){
arr.splice(i,1);
i --;};}};RemoveRepetition_1(arr)
console.log(arr);
2.不修改原数组 进行去除重复元素
var brr =[8,8,8,9,9,9,10,10,11];var s =newSet();functionRemoveRepetition_2(brr){
brr.forEach(item=>s.add(item));var s1 = Array.from(s);
console.log(s1)};RemoveRepetition_2(brr);
console.log(brr)