I have grouped object inside an array according to specific property (in my case location.title).
let grouped = _.mapValues(
_.groupBy(homes.items, "location.title"),
x => x.map(y => _.omit(y, "location.title"))
);
Output result is as :
New York: (2) [{...}{...}]
Washington: (3)[{...}{...}{...}]
my Question is how can i map this output array and get output like this in React app.
Homes in New York : Here goes NewYork homes
Homes in Washington: Here goes Washington homes