// 数组去重var arr = [5,3,5,7,4,3,3,3,5]; 返回[5,3,7,4]
var arr = [5, 3, 5, 7, 4, 3, 3, 3, 5]
var arr1 = []
for (var i = 0; i < arr.length; i++) {
if (arr1.indexOf(arr[i]) == -1) {
arr1.push(arr[i])
}
}
console.log(arr1)
数组去重
最新推荐文章于 2024-10-20 15:12:29 发布