How can I add one key:value pair to object in list where id match between I want to add uuid to list2 where id between list 1 and 2 are the same.
I think I need to combine filter and map, but I cannot work it out. Any suggestions?
list 1
[ { uuid: 26, id: 317 }
{ uuid: 21, id: 451 },
{ uuid: 43, id: 504 }, ]
list 2
[ { id: 317, coords: [ 33.4325301346224, 12.3742694854736 ] },
{ id: 451, coords: [ 43.4257858672581, 14.4208612450748 ] },
{ id: 504, coords: [ 33.4225091429188, 12.395770072937 ] } ]
desired result
[ { id: 317, coords: [ 33.4325301346224, 12.3742694854736 ], uuid:26},
{ id: 451, coords: [ 43.4257858672581, 14.4208612450748 ], uuid:21 },
{ id: 504, coords: [ 33.4225091429188, 12.395770072937 ], uuid:43 } ]