I have an array that I need group by a certain property ("name").
[
{
"name":...
I have an array that I need group by a certain property ("name").
[
{
"name": "cor",
"value": "#e61809",
"sku": "SKU-BICI-EST-TREKMAD-SLR9"
},
{
"name": "cor",
"value": "#3e7555",
"sku": "SKU-BICI-EST-TREKMAD-SLR9-1"
},
{
"name": "tamanho",
"value": "m",
"sku": "SKU-BICI-EST-TREKMAD-SLR9"
},
{
"name": "tamanho ",
"value": "L",
"sku": "SKU-BICI-EST-TREKMAD-SLR9-1"
}
]
and I need to convert to:
{ cor: [{
"name": "cor",
"value": "#e61809",
"sku": "SKU-BICI-EST-TREKMAD-SLR9"
},...