const oddArray = [
{ name: "1", desc: "in odd", cat: "1" },
{ name: "3", desc: "in odd", cat: "2" }
];
const evenArray = [
{ name: "1", desc: "in even", cat: "1"},
{ name: "2", desc: "in even", cat: "1" },
{ name: "4", desc: "in even", cat: "1" }
];
I am trying to combine these arrays into a single array where objects are grouped based on the 'cat' property.
Once merged, I would like to sort this consolidated list by the 'name' property. Are there efficient ways to achieve this?