直接上代码
var arr = [2, 3, 4, 4, 5, 2, 3, 6], arr2 = []; for (var i = 0; i < arr.length; i++) { if (arr2.indexOf(arr[i])<0) { arr2.push(arr[i]); } } console.log(arr2);
标签:style var 代码 span indexof ons col 去重 []
直接上代码
var arr = [2, 3, 4, 4, 5, 2, 3, 6], arr2 = []; for (var i = 0; i < arr.length; i++) { if (arr2.indexOf(arr[i])<0) { arr2.push(arr[i]); } } console.log(arr2);
标签:style var 代码 span indexof ons col 去重 []
原文地址:https://www.cnblogs.com/chenmiaosong/p/8422940.html