Count object array by a field.
E.g.
countBy([{name: 'Alice', sex: 'female'}, {name: 'Bob', sex: 'male'}, {name: 'Choe', sex: 'female'}], 'sex')// returns { female: 2, male: 1 } Copy
countBy([{name: 'Alice', sex: 'female'}, {name: 'Bob', sex: 'male'}, {name: 'Choe', sex: 'female'}], 'sex')// returns { female: 2, male: 1 }
Generated using TypeDoc
Count object array by a field.
E.g.