javaScript对两个数组进行去重

var a = ['a','b','c'];
var b = ['d','e','a','b','c'];
    for (var i = 0; i < a.length; i++) {
        for (var j = 0; j < b.length; j++) {
            if (a[i] == b[j]) {
                b.splice(j,1);
            }
        }
    }
     b;//'d','e'
posted @ 2017-05-17 15:18  春风自是人间客  阅读(177)  评论(0编辑  收藏  举报