Created
February 25, 2018 10:35
-
-
Save a1exlism/934ca19fdb1e4b089274a4da0fa9d050 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var aPromise = new Promise(function (resolve) { | |
resolve(100); | |
// promise 1 | |
}); | |
aPromise.then(function (value) { | |
return value * 2; | |
// return new Promise | promise 2 | |
}); | |
aPromise.then(function (value) { | |
return value * 2; | |
// return new Promise | promise 3 | |
}); | |
aPromise.then(function (value) { | |
console.log("1: " + value); // LOG: 100 | |
// return new Promise | promise 3 | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment