Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. var bar = new Promise(function (resolve) {
  2. setTimeout(function () { reject('error'); }, 50);
  3. });
  4.  
  5. bar.then(function() {}, function (reject) {
  6. console.log('reject:', reject);
  7. }); // reject:error
  8.  
  9. bar.catch(function (reject) {
  10. console.log('catch:', reject);
  11. }); // catch:error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement