2
How can I do a check on a array of objects where the intention would be to eliminate duplicates however, I need to add the values of a property?
Example: I have a array object:
musicas = [{nome: 'Música 1', clicks: 1}, {nome: 'Música 1', clicks: 1}]
I need to return a new array from this without repeating the songs but adding the total clicks.
Something that stayed that way:
musicas = [{nome: 'Música 1', clicks: 2}]
In your example you have
Musica
without accent in theu
and with accent... are different names?– Sergio
They’re the same thing. I forgot the accent. I’m sorry.
– David Coelho