Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var bar = new Promise(function (resolve) {
- setTimeout(function () { reject('error'); }, 50);
- });
- bar.then(function() {}, function (reject) {
- console.log('reject:', reject);
- }); // reject:error
- bar.catch(function (reject) {
- console.log('catch:', reject);
- }); // catch:error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement