Skip to content

Instantly share code, notes, and snippets.

@irridescentrambler
Last active January 26, 2019 08:32
Show Gist options
  • Save irridescentrambler/a32c780a8b3c90f75f71d785b7d19988 to your computer and use it in GitHub Desktop.
Save irridescentrambler/a32c780a8b3c90f75f71d785b7d19988 to your computer and use it in GitHub Desktop.
new Promise((resolve, reject) => {
console.log('Initial');
resolve();
})
.then(() => {
throw new Error('Something failed');
console.log('Do this');
})
.catch(() => {
console.log('Do that');
})
.then(() => {
console.log('Do this, no matter what happened before');
});
// Output
// Initial
// Do that
// Do this, no matter what happened before
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment