Skip to content

Instantly share code, notes, and snippets.

@lcherone

lcherone/script.js

Created Jun 27, 2020
Embed
What would you like to do?
asynchronous IIAFE in a for loop, with step timing
console.log('asynchronous IIAFE in a for loop, with step timing')
for (let i = 0; i <= 10; i++)
setTimeout(
async () =>
(async function (index) {
console.log(index)
})(i),
i * 250
)
console.log('yup, its async')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment