Created
January 15, 2021 01:50
-
-
Save nafeu/214805c9ff32b7965de785e9c7a9de98 to your computer and use it in GitHub Desktop.
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
async function main() { | |
console.log('1 | print immediately'); | |
console.log(await delay(() => '2 | print after one second', 1000)); | |
console.log(await delay(() => '3 | print one second after line 2', 1000)); | |
console.log(await delay(() => '4 | print one second after line 3', 1000)); | |
console.log(await delay(() => '5 | print one second after line 4', 1000)); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment