Javascript:减少对象数组,并在当前对象与先前值的某些键匹配时删除当前对象

有什么有效的方法可以减少数组并删除当前值(如果它与先前值的某些键匹配)?

例如:

const foo = [
    {a: "john", b: true, c: false},
    {a: "franck", b: true, c: false},
    {a: "jack", b: false, c: false},
    {a: "stephen", b: true, c: false},
    {a: "paul", b: true, c: false},
    {a: "helen", b: true, c: false},
  ];

结果将是这样的:

 const bar = [
    {a: "john", b: true, c: false},
    {a: "jack", b: false, c: false},
    {a: "stephen", b: true, c: false},
  ];

找不到不需要100行编码的东西...

评论