Skip to content

Instantly share code, notes, and snippets.

@ir3ne
Created September 4, 2020 13:20
Show Gist options
  • Save ir3ne/1fe280e02f40165fb1eafd87db324e61 to your computer and use it in GitHub Desktop.
Save ir3ne/1fe280e02f40165fb1eafd87db324e61 to your computer and use it in GitHub Desktop.
const delay = () => {
setTimeout(() => {
console.log('me the last one!');
}, 4000);
}
async function fire() {
try {
const runDelay = await delay();
return runDelay();
} catch(error) {
return 'Something went wrong'
}
}
fire();
console.log('me first!');
console.log('me second!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment