How can I merge 2 nested objects in an array into a new array?

Viewed 21

I currently have an array called "data" with 2 objects nested inside, "incoming" and "outgoing" as the screenshot below:

enter image description here

How can I add these into a new array called "items" and remove "incoming" and "outgoing" so they're just a list of items?

I want to make it like the array from this screenshot below:

enter image description here

so just merging the 2 objects as single objects within a new array?

Thanks in advance!!

0 Answers
Related