Below is input and output
//Input: [{a:2}, {b:3},{a:2},{b:3}]
// Output: {
// a:4,
// b:6
// }
Result is same key`s added value
Below is input and output
//Input: [{a:2}, {b:3},{a:2},{b:3}]
// Output: {
// a:4,
// b:6
// }
Result is same key`s added value
Check if the k is in the output, is so increment, else create
var output = {}
for (let e of input) {
var k = e.keys()[0]
if (k in output) {
output[k] += e[k]
} else {
output[k] = e[k]
}
}