-
-
Save I-0-I/971134a22a425c0717b1ebd21a1979bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
then =>100
then =>200
then =>300
cath =>Я иду в catch
then =>500
then =>600