Guest User

Untitled

a guest
Mar 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. // - 1 -
  2. // after fullfill -> always
  3. Promise.resolve(42)
  4. .then(() => console.log('after fullfill'))
  5. .catch(() => console.log('after reject'))
  6. .finally(() => console.log('always'));
  7.  
  8. // - 2 -
  9. // after reject -> always
  10. Promise.reject(42)
  11. .then(() => console.log('after fullfill'))
  12. .catch(() => console.log('after reject'))
  13. .finally(() => console.log('always'));
Add Comment
Please, Sign In to add comment