5
I have the following list:
nomes = [
{ nome: "flavio", valor: 10 },
{ nome: "flavio", valor: 20 },
{ nome: "fran", valor: 30 },
{ nome: "fran", valor: 40 },
{ nome: "Roberto", valor: 50},
{ nome: "Roberto", valor: 50 }
];
How do I get:
subtotais = [
{nome:"flavio", total:30},
{nome:"fran", total:70},
{nome:"Roberto", total:10}]
I appreciate any help.
Before arriving at this array, you have some query returns that data?
– Marconi
The value of
Roberto
is wrong in your example– Sorack
I can’t find the green V to accept the answer.
– Flavio Cardoso
Has any response helped solve the problem and can address similar questions from other users? If so, make sure to mark the answer as accepted. To do this just click on the left side of it (below the indicator of up and down votes).
– Sorack