我有两个这样的对象。如何使用Javascript或Lodash从arrayList中删除特定对象
var find = [{
licenseId: 'A123',
batchId: '123',
name: 'xxx'
},
{
licenseId: 'B123',
batchId: '124',
name: 'yyy'
}];
var result = [
{
licenseId: 'A123',
batchId: '123',
name: 'xxx',
tag: 'college',
sem: 'fourth'
},
{
licenseId: 'B123',
batchId: '124',
name: 'yyy',
tag: 'college',
sem: 'third'
},
{
licenseId: '1111',
batchId: 'C123',
name: 'yyy',
tag: 'college',
sem: 'second'
},
{
licenseId: '3456',
batchId: 'B123',
name: 'yyy',
tag: 'college',
sem: 'second'
}];
我想删除结果已与所有三个属性匹配找到对象的对象。我想要的结果应该是这样的:
[{
licenseId: '1111',
batchId: 'C123',
name: 'yyy',
tag: 'college',
sem: 'second'
},
{
licenseId: '3456',
batchId: 'B123',
name: 'yyy',
tag: 'college',
sem: 'second'
}];
你能协助吗?
请张贴你的努力 – mplungjan
你确定多么希望最终结果看起来像吗?我的意思是你拿一个licenseId并把它作为一个batchId。最终的结果是,你有一个3456的licenseId,但是这在起始数组中并不存在。 –