Code QuizIntermediate

forEach ignores promises: use for...of or Promise.all

See why awaiting inside Array.forEach does not actually pause the loop and how to fix it.

Codejavascript
async function saveAll(items) {
  items.forEach(async (item) => {
    await db.save(item);
  });
  console.log('All items saved');
}

The log should only print after every item is saved. What is the bug?