Created
June 5, 2019 00:47
-
-
Save Matt-Jensen/7979cc5bed0faf206628042c305ca3a0 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 () => { | |
const itterations = Array.from({length: 4}); | |
console.log('starting'); | |
itterations.map(async (_, i) => { | |
await wait(300); | |
console.log(`itteration done ${i}`); | |
}); | |
await wait(100); | |
console.log('finishing'); | |
})(); | |
function wait(tm = 0) { | |
return new Promise(resolve => | |
setTimeout(resolve, tm) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment