var arr = [1,1,1,2,3,3,4,5,6,6]; function deleteSameNum(nums){ let reuslt = []; for(let i=0; i< nums.length; i++){ if(reuslt.indexOf(nums[i]) < 0){ reuslt.push(nums[i]) } } return reuslt; } console.log(deleteSameNum(arr))