方法一:js数组id去重,value值相加问题 来源:https://www.jianshu.com/p/8f79e31b46ed // js let arr = [ { id: 1, value: 5 }, { id: 2, value: 3 }, { id: 3, value: 4 }, { id: 1, value: 3 }, { id: 2, value: 3 } ]; let newArr = []; arr.forEach(el=> { const res = newArr.find…