How can I make a check in an array of objects where the intention would be to delete the duplicates however, do I need to add the values of a property?
Example: I have an array of objects:
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 number of clicks.
Something that looks like this:
musicas = [{nome: 'Música 1', clicks: 2}]