面试总结
2018-09-13 本文已影响0人
FreddyHuang
let arr = [1.2,3,3,4,4,5,6,56,12,12];
const unque = arr=>{
let newArr = [];
arr.forEach(element => {
if(newArr.indexOf(element) < 0){
newArr.push(element);
}
});
return newArr;
}
console.log(unque(arr));