I am developing an application on AngularJS (1) and I can not figure out how to split array of items in another array group by item.
I mean I have an array of different
You can also use an established library like lodash to make it a lot simpler and save yourself the trouble:
let arr = [
{"name": "toto", "uuid": 1111},
{"name": "tata", "uuid": 2222},
{"name": "titi", "uuid": 1111}
]
let grouped = _.groupBy(arr, 'uuid')
console.log(grouped)
console.log(Object.values(grouped))