Skip to content

Instantly share code, notes, and snippets.

@lcsjunior
Created February 10, 2022 23:55
Show Gist options
  • Save lcsjunior/243f97fdd924c22c362cf811733838aa to your computer and use it in GitHub Desktop.
Save lcsjunior/243f97fdd924c22c362cf811733838aa to your computer and use it in GitHub Desktop.
const recursiveCall = (index) =>
new Promise((resolve) => {
console.log(index);
if (index < 3) {
return resolve(recursiveCall(++index));
} else {
return resolve();
}
})
recursiveCall(0).then(() => console.log('done'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment