I have two arrays which id like to merge into one array, however, the arrays have some complexities which I can't wrap my head around.... In short, I have an array of "last message" from a conversation, and I have an array of participants from that conversation.
The "messages" array looks like this
messageArray =
[
[
{ message } <=== convo 1
],
[
{ message } <=== convo 2
],
]
The "participant" data array looks like this
participantArray =
[
[
{participant},{participant} <=== participants in convo 1
],
[
{participant},{participant},{participant} <=== participants in convo 2
]
]
What i'd like to have is
mergedArray =
[
[ { message }, [ { participant }, { participant } ]] <=== conversation 1
],
[
[ { message }, [ { participant }, { participant } ]] <=== conversation 2
]
[<>]), we need: Your code, data example