I have an array like this:
I would like to group and get the sum of each repetition like this:
Using lodash:
var data; // the data represented by your screenshot var counts = _.chain(data) .groupBy('AGENDADOR') .map(_.size) .value();
counts will now be an object like this:
counts
{ "AGE270": 9, "AGE203": 5, // etc }