Looking to combine two arrays based on the same id, merging them into one array.
Example:
{
"id":1212,
"instructor":"william",
...
}
Array 1:
[
{
"id":1212,
"name":"accounting",
...
},
{
"id":1212,
"name":"finance",
...
}
]
Desired Result:
{
"id": 1212,
"instructor": "william",
"Courses": [
{
"id":1212,
"name":"accounting",
...
},
{
"id":1212,
"name":"finance",
...
}
]
}