Yeah especially waiting for promises to resolve and parallel stuff with async/await.
For example i see this in a lot of my code reviews with new js programmers:
// does some parallel async stuff
arrayOfItems.forEach(async item => {
await doSomethingAsync(item)
})
doSomethingWhenDone()
This won't wait for the promise to actually resolve outside of the forEach and call doSomethingWhenDone(). If your program exist it will not wait for your async work to be done.
135
u/theMightyPanda27 May 28 '19
Promises. They are quite tricky to understand for a beginner, but very convenient as one masters.