Skip to content

Instantly share code, notes, and snippets.

Created June 30, 2018 03:39
What would you like to do?
Bad example of using async/await for delaying calls in a loop
const delay = time =>
new Promise(resolve => setTimeout(resolve, time));
const list = new Array(10).fill();
list.forEach(async (_, index) => {
await delay(1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment