Created
June 27, 2020 01:31
-
-
Save lcherone/7474247d6f42f8e9dc7541226eff2718 to your computer and use it in GitHub Desktop.
asynchronous IIAFE in a for loop, with step timing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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