Created
January 14, 2018 22:17
-
-
Save schahriar/c106e6043ddf2bd9d77cbeebd7a31697 to your computer and use it in GitHub Desktop.
Delayed loop #async-await #medium
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
const randForTen = async () => { | |
let results = []; | |
for (let i = 0; i < 10; i++) { | |
await timeoutPromise(1000); | |
results.push(Math.random()); | |
} | |
return results; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment