1.数组去重
function qc(arr2){ let arr = []; for( let i = 0; i < arr1.length; i++) { if( arr.indexOf(arr1[i]) == -1) { arr.push(arr1[i]) } } return arr; } arr1 = ["1","1","3","5","2","24","4","4","a","a","b"]; console.log(qc(arr1));
1.数组去重
function qc(arr2){ let arr = []; for( let i = 0; i < arr1.length; i++) { if( arr.indexOf(arr1[i]) == -1) { arr.push(arr1[i]) } } return arr; } arr1 = ["1","1","3","5","2","24","4","4","a","a","b"]; console.log(qc(arr1));