标签:return push func 数组去重 new turn 数组 current []
数组去重
norepeat(array)
function norepeat(array){ var newArray=[]; for (var i in array){ var current=array[i]; var flag = false; for (var j in newArray){ if (newArray[j]===current){ flag=true; break; } } if (!flag){ newArray.push(current); } } return newArray; }
标签:return push func 数组去重 new turn 数组 current []
原文地址:http://www.cnblogs.com/zhuxiaopeng/p/6848389.html