使用下划线比较两个对象并用一个对象替换共同值

compare two objects using underscore and replace the common values with one object

我想比较两个对象并创建一个新对象。如果一个对象中的 属性 不存在,则应将其替换为其他对象,否则不应更改

let result = this.monthobj.map(el=>{
    this.monthobj2.forEach(ele=>{
      if(el.month == ele.month && el.value != ele.value){
        el.value = ele.value;
      }
    })
    return el;
  })

更新后的答案:Stackblitz