Information:
[
{
"id": "ewq123",
"name": "Joshua",
"order": "Pizza"
},
{
"id": "ewq123",
"name": "Joshua",
"order": "Burger"
},
{
"id": "a512dsa",
"name": "Eugene",
"order": "Pizza"
},
]
Desired outcome:
[
{
"id": "ewq123",
"name": "Joshua",
"order": ["Burger", "Pizza"]
},
{
"id": ""a512dsa",
"name": "Eugene",
"order": "Pizza"
},
]
Are there more efficient ways to achieve this using ES6 functions, such as the spread operator?