Skip to content

Instantly share code, notes, and snippets.

@I-0-I
Created February 15, 2017 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save I-0-I/971134a22a425c0717b1ebd21a1979bb to your computer and use it in GitHub Desktop.
Save I-0-I/971134a22a425c0717b1ebd21a1979bb to your computer and use it in GitHub Desktop.
(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
Copy link
Author

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