Spot the bug in notification delivery

from The event loop
Node 24 intermediate 4 min 1 issue to find

Find why this function reports completion before every notification is sent.

JavaScript
async function notifyAll(client, recipients) {
  recipients.forEach(async (recipient) => {
    await client.send(recipient);
  });
  return { sent: recipients.length };
}
Open in playground
Report an error