标签:
function uniqid(arr){ var newArr = []; var c; for(var i = 0 ;i <= arr.length ;i++){ c = false; for(var j = 0 ;j <= newArr.length ;j++){ if(arr[i] == newArr[j]){ c = true; break; } } if(!c){ newArr.push(arr[i]); } } return newArr; } var arr1 = [1,2,3,2]; var b =uniqid(arr1); console.log(b);
标签:
原文地址:http://www.cnblogs.com/bestsamcn/p/5209208.html