Javascript obj assignment/mutation in for-loops
I think this is what you're looking for

const uuidGenerator = () =&gt; Math.random();

const message = {
  message: 'hello',
  recipients: ['John', 'Susie', 'Christian'],
};

function split(obj) {
  const { message, recipients, ...remaining } = obj;
  return recipients.map((recipient) =&gt; {
    return { id: uuidGenerator(), message, ...remaining, recipient: recipient };
  });
}

const arrOfMessages = split(message);
console.log(arrOfMessages);


if there are too many values that you want to copy from the actual obj, then you can use the spread operator i.e., remaining in this case. 

However, I am not sure about how efficient this is. These are possible approaches: 
- Object.assign
- Spread Operator
- manually adding keys to base Object
Because, I have seen instances where each of these perform differently based on the sample size.

I remember that last approach is faster if your sample size is huge.