Created
March 1, 2018 12:55
-
-
Save omartrigui/90088c28ca5babc1154ecc55a9811016 to your computer and use it in GitHub Desktop.
Looping with async/await
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
(async() => { | |
for (let param of params) { | |
try { | |
let result = await asyncFunction(param); | |
console.log(result); | |
} catch (error) { | |
console.error(error); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment