# groupBy
Groups values in an array of objects by the provided property.
const x = [
{
name: "Ivan",
company: "Google"
},
{
name: "Kenny",
company: "Google"
},
{
name: "Joseph",
company: "Amazon"
}
];
groupBy(x, "company");
Result:
{
"Google": [
{
"name": "Ivan",
"company": "Google"
},
{
"name": "Kenny",
"company": "Google"
}
],
"Amazon": [
{
"name": "Joseph",
"company": "Amazon"
}
]
}