I want to merge two arrays from the db into one without overwriting the data, I have tried different options with lodash merge, concatenate and other but without luck. Can you please help!
My objects:
places: [
{ placeId: 2, place: 'a' },
{ placeId: 3, place: 'b' },
{ placeId: 4, place: 'c' },
{ placeId: 5, place: 'd' },
{ placeId: 6, place: 'e' }
]
places: [
{ placeId: 12, place: 'f' },
{ placeId: 13, place: 'g' },
{ placeId: 14, place: 'h' },
{ placeId: 21, place: 'i' },
{ placeId: 22, place: 'j' },
{ placeId: 29, place: 'k' },
{ placeId: 30, place: 'l' }
]
i want to get this
places:[
{ placeId: 2, place: 'a' },
{ placeId: 3, place: 'b' },
{ placeId: 4, place: 'c' },
{ placeId: 5, place: 'd' },
{ placeId: 6, place: 'e' },
{ placeId: 12, place: 'f' },
{ placeId: 13, place: 'g' },
{ placeId: 14, place: 'h' },
{ placeId: 21, place: 'i' },
{ placeId: 22, place: 'j' },
{ placeId: 29, place: 'k' },
{ placeId: 30, place: 'l' }
]