Skip to content

Instantly share code, notes, and snippets.

@I-0-I

I-0-I/examplePromise.js Secret

Created Feb 15, 2017
Embed
What would you like to do?
(function(){
const promise = new Promise((resolve, reject) => resolve(100));
promise
.then(function(value){
console.log('then =>' + value);
})
.then(() =>{
return 200
})
.then(function(value){
console.log('then =>' + value);
return 300
})
.then(function(value){
console.log('then =>' + value);
throw 'Я иду в catch'
})
.catch(function(value){
console.log('cath =>' + value);
return 500
})
.then(function(value){
console.log('then =>' + value);
return 600
})
.then(function(value){
console.log('then =>' + value);
return 700
});
})();
@I-0-I

This comment has been minimized.

Copy link
Owner Author

@I-0-I I-0-I commented Feb 15, 2017

then =>100
then =>200
then =>300
cath =>Я иду в catch
then =>500
then =>600

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.