Last active
February 19, 2019 07:07
-
-
Save keyvan-m-sadeghi/d4a828568e9eb4c1520a264ea3a36d10 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
let p = delay(500); | |
p.then(() => console.log('1st then!')); // after 0.5 seconds, logs 1st then! | |
p.then(() => console.log('2nd then!')); // after 0.5 seconds, logs 2nd then! | |
p.then(() => console.log('3rd then!')); // after 0.5 seconds, logs 3rd then! | |
p = p.then(() => Nancy.reject()); | |
p.catch(() => console.log('1st catch!')); // after 0.5 seconds, logs 1st catch! | |
p.catch(() => console.log('2nd catch!')); // after 0.5 seconds, logs 2nd catch! | |
p.catch(() => console.log('3rd catch!')); // after 0.5 seconds, logs 3rd catch! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment