const people = [
{ name: 'John', age: 28 },
{ name: 'Jane', age: 28 },
{ name: 'Joe', age: 32 }
];
const grouped = people.groupBy(person => person.age);
// { 28: [John, Jane], 32: [Joe] }
About: I am Anjali Gurjar Work as Software Developer, I have total experience 4.5 .
const people = [
{ name: 'John', age: 28 },
{ name: 'Jane', age: 28 },
{ name: 'Joe', age: 32 }
];
const grouped = people.groupBy(person => person.age);
// { 28: [John, Jane], 32: [Joe] }