Created
June 9, 2020 02:43
-
-
Save djD-REK/1cda61a6c8ae3ef7a80713d44f4b8376 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
const sleepNow = (delay) => new Promise((resolve) => setTimeout(resolve, delay)) | |
async function repeatedGreetingsLoop() { | |
for (let i = 1; i <= 5; i++) { | |
await sleepNow(1000) | |
console.log(`Hello #${i}`) | |
} | |
} | |
repeatedGreetingsLoop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment