I have an Array like this
var array = [
{occurrences: 1, position: "1"},
{occurrences: 4, position: "2"},
{occurrences: 1, position: "1"},
{occurrences: 2, position: "3"},
];
And I want to sum it up like this:
{occurrences: 2, position: "1"},
{occurrences: 4, position: "2"},
{occurrences: 2, position: "3"}
Can I achieve this by using lodash or anything else?