Skip to content

Instantly share code, notes, and snippets.

@khaosdoctor
Created April 7, 2019 17:04
Show Gist options
  • Save khaosdoctor/f6290e2cfb57b8bb6e0b9fb7f91cd330 to your computer and use it in GitHub Desktop.
Save khaosdoctor/f6290e2cfb57b8bb6e0b9fb7f91cd330 to your computer and use it in GitHub Desktop.
const p = new Promise((resolve, reject) => {
if (Math.random() > 0.5) resolve('yay')
reject('no')
})
p.then(console.log)
.catch(console.error)
.finally(() => console.log('Eu sempre sou executado')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment