Created
November 23, 2020 11:22
-
-
Save elmissouri16/eb9680874f556d94279709117a004f88 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function delay(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
(async () => { | |
for (let index = 0; index < 10; index++) { | |
await delay(2000).then(() => console.log(index)) | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment