Skip to content

Latest commit

 

History

History
13 lines (13 loc) · 309 Bytes

promise-succeed.md

File metadata and controls

13 lines (13 loc) · 309 Bytes

@ katopz

What console log will print?

new Promise(reject => { throw 'foo' && reject('bar') })
  .then(
    result => console.log(`succeed:${result}`),
    err => console.log(`failed:${err}`))
  .catch(err => console.log(`catch:${err}`))
  • "succeed:bar"
  • "failed:bar"
  • "failed:foo"
  • "catch:foo"