标签:span div cti 两种 OLE class var 设置 for
<script> var arr=[2,2,3,3,4,4,5,5,6,6] function norepeat(arr) { for (var i=0;i<arr.length;i++){ for(var j=i+1;j<arr.length;j++){ if (arr[i]==arr[j]){ arr.splice(j,1) } } } return arr } console.log(norepeat(arr)) </script>
var arr=[1,18,2,3,23,4,4,5,5,6] var brr=[]; function norepeat(arr) { for (var i=0;i<=arr.length;i++){ if (arr[i]!=arr[i+1]){ brr.push(arr[i]) } } return brr } console.log(norepeat(arr))
标签:span div cti 两种 OLE class var 设置 for
原文地址:https://www.cnblogs.com/hy96/p/11380112.html