删除数组对象 相同的值 制定数组对象
var a = [ { id: 1, name: 'hong' }, { id: 2, name: 'huang' }, { id: 3, name: 'lan' } ] var b = [ { id: 1, name: 'hong' }, { id: 2, name: 'lan' }, { id: 4, name: 'lv' } ] b.forEach(item => { a = a.filter(a => a.id != item.id) }) console.log(JSON.stringify(a))
原链接: https://www.cnblogs.com/guozongzhang/p/10921550.html