Skip to content

Instantly share code, notes, and snippets.

@jaydson
Created March 8, 2021 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaydson/f1ff5431403194e45eae16fc8a754cd3 to your computer and use it in GitHub Desktop.
Save jaydson/f1ff5431403194e45eae16fc8a754cd3 to your computer and use it in GitHub Desktop.
new Promise(function(resolve, reject) {
console.log('A'); // será executado reject();
// irá rejeitar a promise
console.log('B'); // será executado
throw(new Error('Falhou')); // lança uma excpetion
console.log('C'); // não será executado
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment