【发布时间】:2016-08-16 06:19:13
【问题描述】:
我有两个这样的对象。
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'
}];
我想删除与 find 对象的所有三个属性匹配的 Result 对象。我希望结果应该是这样的:
[{
licenseId: '1111',
batchId: 'C123',
name: 'yyy',
tag: 'college',
sem: 'second'
},
{
licenseId: '3456',
batchId: 'B123',
name: 'yyy',
tag: 'college',
sem: 'second'
}];
你能帮忙吗?
【问题讨论】:
-
请发表你的努力
-
你确定这就是你想要的最终结果吗?我的意思是您获取 licenseId 并将其作为 batchId。最终结果是您的 licenseId 为 3456,但它甚至不存在于起始数组中。
标签: javascript node.js underscore.js lodash