I have an array that looks something like this:
currArray =
[
['a', 2],
['b', 3],
['c', 5],
['a', 2],
['b', 4],
['d', 6]
]
I am trying to combine the arrays that have the same value at [0], while adding the values at [1]. So the output would look like:
newArray =
[
['a', 4],
['b', 7],
['c', 5],
['d', 6]
]
Currently trying this via Vanilla JavaScript and lodash.
Any advice is much appreciated.