var a = [
{
id: 1,
name: "..."
},
{
id: 2,
name: "..."
}
]
var b = [
{
id: 1,
age: 10
},
{
id: 2,
age: 10
}
]
for example, with the above two arrays, I hope to get the following results:
[{ id: 1, name: "...", age: 10 }, { id: 2, name: "...", age: 10 }]
is there any more efficient way? There is no guarantee that the order of id in an and b is the same