Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nafeu/ba2694a724e89c8fe8ed939be3c2ad90 to your computer and use it in GitHub Desktop.
Save nafeu/ba2694a724e89c8fe8ed939be3c2ad90 to your computer and use it in GitHub Desktop.
console.log('1 | print immediately');
delay(() => {
throw new Error('This is a fake error.');
return '2 | print after one second';
}, 1000)
.then(result => console.log(result))
.catch(error => console.log(error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment