Common mistakes with async code:
- Forgetting
await(you get a promise, not the value) - Using
awaitoutside async functions - Sequential awaits when parallel works
- Not catching errors
// Wrong: forEach doesn't wait
arr.forEach(async (x) => await process(x));
// Right: use for...of
for (const x of arr) await process(x);