Created
March 14, 2018 07:19
-
-
Save jasonweng/2a3e7e7b7c2e9433ee496d8dad70e226 to your computer and use it in GitHub Desktop.
Front end interview tests
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
var p1=new Promise(resolve => { | |
console.log(1) | |
resolve(2) | |
}) | |
var p2=new Promise(resolve => { | |
console.log(3) | |
resolve(p1) | |
}) | |
p1.then(re => { | |
console.log(re) | |
}) | |
p2.then(re => { | |
console.log(re) | |
}) | |
/*=============================== | |
1 | |
3 | |
2 | |
2 | |
Promise {<resolved>: undefined} | |
=================================*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment