Last active
February 9, 2018 05:25
-
-
Save tonkotsuboy/d21d1c1acaa77b2dbf890545285eccaf to your computer and use it in GitHub Desktop.
await/async
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() { | |
const response = await fetch(url1); | |
const arrayBuffer1 = await response.arrayBuffer(); | |
const response2 = await fetch(arrayBuffer1.url); | |
const arrayBuffer2 = await response2.arrayBuffer(); | |
console.log(arrayBuffer1, arrayBuffer2); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment