Last active
April 6, 2020 16:36
-
-
Save patricktargun/55c409ea0739fcee813547cb5d7a5611 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
function timeout(ms) { | |
return new Promise(r => setTimeout(r, ms)); | |
} | |
var files = [ | |
{ hi: 1 }, | |
{ hi: 2 } | |
] | |
async function printFiles () { | |
for (const file of files) { | |
const contents = await timeout(3000); | |
console.log(file); | |
} | |
} | |
printFiles() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment