js-数组去重

function arrQC(arr){
    let temp = [];
    arr.forEach((item,idx)=>{
        if(temp.indexOf(item)<0){
            temp.push(item)
        }
    })
    return temp;
}

猜你喜欢

转载自www.cnblogs.com/huangmin1992/p/10152599.html
今日推荐