arr = [12,5,6,4,5,6,7,12,0,5,6,7,5,4,5,0]
let newarr = arr.filter((item,index,nowArr) => nowArr.indexOf(item) === index) //数组去重
拆分:
let newarr = arr.filter (function (item,index,nowArr) {
return nowArr.indexOf(item) === index;
})
console.log(newarr) // [12, 5, 6, 4, 7, 0]