I have an array of objects that look like this:
const myArray = [
{ taxonomy: 'Orange', slug: 'value1'},
{ taxonomy: 'Orange', slug: 'value2'},
{ taxonomy: 'Green', slug: 'value3'},
]
I want to convert the object's slug into arrays in javascript and map those have the same taxonomy together:
Result:
[
[value1, value2], // because they share the same taxonomy property.
[value3]
];
Please help me if you have experienced this. Thank you very much.