Skip to content

Instantly share code, notes, and snippets.

@bushyn
Created September 2, 2016 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bushyn/f0d6b174c9eadadcaeeb54bbf5881df5 to your computer and use it in GitHub Desktop.
Save bushyn/f0d6b174c9eadadcaeeb54bbf5881df5 to your computer and use it in GitHub Desktop.
Array(4).fill()
.map(_ => _ => Promise.all(Array(2).fill().map(x => fetch('example.com').then(resp =>resp.json()))).then(arrJson=>console.log(arrJson)))
.reduce((prev, curr) => prev.then(curr), Promise.resolve())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment