Arrange array of objects from the received data.
Here is the data that I received.
[ {name:someName, value:20},
{name:"", value:21}
{name:someName, value:25}
{name:someName , value:27}
{name:"", value:21}
{name:someName, value:20}
]
I am looking to group it in the following way.
[ {name:someName, value:20},
{name:"", value:42}
{name:someName, value:25}
{name:someName , value:27}
{name:someName, value:20}
]
I attempted to achieve this using filter and reduce functions in JavaScript.