Currently, I am working on sending information by looping over an array that is nested within another array using the broadcast function. My challenge is to broadcast the message in reverse order without actually reversing the array I am iterating through. If you have any thoughts or suggestions on how to achieve this, please share.
const interval = setInterval(() => {
array.map((message, index, arr) => {
broadcast(clients, JSON.stringify(message));
if (index == array.length) {
clearInterval(interval);
}
});
}, 1000);