Created
November 18, 2016 20:37
-
-
Save brandonmp/a7d610ef5a334e9f470ff37c2e8ee6a9 to your computer and use it in GitHub Desktop.
basically a sequential asynchronous 'foreach' replacement that uses async/await
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 function main() { | |
for (let item of iterable) { | |
try { | |
const res = await fetch('http://www.example.com', { method: 'HEAD' }) | |
} catch (e) { | |
console.error(e) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment