Two JSON inputs are provided:
[
{
userId: 32159,
userFirstName: "john",
userLastName: "doe",
plans: [ ]
},
{
userId: 32157,
userFirstName: "dave",
userLastName: "mess",
plans: [ ]
}
]
and
[
{
userId: 32159,
userFirstName: "john",
userLastName: "doe",
results: [ ]
},
{
userId: 32157,
userFirstName: "dave",
userLastName: "mess",
results: [ ]
}
]
I require the following combined output:
[
{
userId: 32159,
userFirstName: "john",
userLastName: "doe",
plans: [ ],
results: [ ]
},
{
userId: 32157,
userFirstName: "dave",
userLastName: "mess",
plans: [ ],
results: [ ]
}
]
Seeking assistance to achieve this in JavaScript. The 'userId' field is unique in this case.