I have an array of object, which has be combined based on a unique attribute.
For example:
[
{ "macId": "123", "input": 30},
{ "macId": "567", "input": 40},
{ "macId": "123", "power": 100},
{ "macId": "567", "power": 250}
]
I want the resultant array of object as the following:
[
{ "macId": "123", "input": 30, "power": 100},
{ "macId": "567", "input": 40 "power": 250}
]
Is this possible with lodash? If not, how can I write a short code for this to do so?
Array.reduceand some algorithm