I have the following information
[[{aceptacion: 1, rechazo: 2},
{aceptacion: 0, rechazo: 1}],
[{aceptacion: 2, rechazo: 2},
{aceptacion: 0, rechazo: 7}],
[{aceptacion: 0, rechazo: 2},
{aceptacion: 0, rechazo: 3}]]
and I need the following answer:
[{aceptacion: 3, rechazo: 6},
{aceptacion: 0, rechazo: 11}]
but I do not know how to add to reach that result.
in serious theory:
add the acceptances of the first Object of each arrangement, 1 + 2 + 0 = 3
add the acceptances of the second Object of each arrangement, 0 + 0 + 0 = 0
....... up to element N
and the same with rejections
my intent is:
let arreglo = [
[{
aceptacion: 1,
rechazo: 2
},
{
aceptacion: 0,
rechazo: 1
}
],
[{
aceptacion: 2,
rechazo: 2
},
{
aceptacion: 0,
rechazo: 7
}
],
[{
aceptacion: 0,
rechazo: 2
},
{
aceptacion: 0,
rechazo: 3
}
];
let suma
arreglo.forEach(function(d) {
d.[0]
})