数组去重

public quchong(arr): any {
    let hash = [];
    for (var i = 0; i < arr.length; i++) {
        if (arr.indexOf(arr[i]) == i) {
            hash.push(arr[i]);
        }
    }
    return hash;
}
            

 

posted @ 2020-05-07 10:17  程序&#128049;  阅读(90)  评论(0编辑  收藏  举报