js 根据一个数组元素,删除另一个数组中的对象

var a = [{ id: 15 }, { id: -1 }, { id: 0 }, { id: 3 }, { id: 12.2 }];
var b = [15, 3];
a = a.filter(function (item) {
            return b.indexOf(item.id) < 0;
        })

console.log(a);
原文地址:https://www.cnblogs.com/rockyan/p/9504986.html