Last active
November 12, 2018 21:10
-
-
Save dimroc/ec6a7f402891bf7ba1cd28504946fad2 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
#!/usr/bin/env node | |
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
const countdown = async () => { | |
await delay(5000) | |
console.log("hello world") | |
} | |
countdown() | |
console.log("bye world. Although out of order, notice how application does not exit until final await.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: