Created
September 4, 2020 13:20
-
-
Save ir3ne/1fe280e02f40165fb1eafd87db324e61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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