"y" :"9000", }] how to group this into 1 object eg x = what and y = what ??
Send what you have and what you want it to be.
data.reduce((acc, cur) => { Object .keys(cur) .forEach(key => acc[key] = (acc[key] || 0) + Number(cur[key])); return acc; },{});
Обсуждают сегодня