Skip to content

Instantly share code, notes, and snippets.

@hnakamur hnakamur/index.html
Created Sep 18, 2017

What would you like to do?
await in loop experiment
<!DOCTYPE html>
<meta charset="utf-8"/>
<title>Async await loop experiment</title>
function foo(i) {
return new Promise((resolve, reject) => {
console.log('foo', i);
(async function() {
for (var i = 0; i < 4; i++) {
await foo(i);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.