Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@littledan
Created September 21, 2016 21:17
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 littledan/6578a99c2deed7d83143c42bcaab2387 to your computer and use it in GitHub Desktop.
Save littledan/6578a99c2deed7d83143c42bcaab2387 to your computer and use it in GitHub Desktop.
var resolve;
var promise = new Promise(r => resolve = r);
async function foo(i) {
if (i > 100000) return promise;
return foo(i+1);
}
foo(0);
resolve();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment