let newArr = [] allMonth.forEach(el=> { const res = newArr.findIndex(ol=> { return el.month === ol.month; }); if (res !== -1) { newArr[res].value = newArr[res].value + el.value } else { newArr.push(el); } }) 学废了吗?