Last active
September 26, 2016 09:32
-
-
Save risentveber/1a530be0fe25c103c0a025bbfe926f6a 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
new Promise(function(resolve){ | |
setTimeout(function() { | |
console.log(1); | |
resolve(); | |
}, 1000); | |
}).then(function() { | |
let nextPromise = new Promise(function(resolve){ | |
setTimeout(function() { | |
console.log(2); | |
resolve(); | |
}, 1000); | |
}); | |
return nextPromise; | |
}).then(function() { | |
let nextPromise = new Promise(function(resolve){ | |
setTimeout(function() { | |
console.log(3); | |
resolve(); | |
}, 1000); | |
}); | |
return nextPromise; | |
}).then(function() { | |
setTimeout(function() { | |
console.log(4); | |
}, 1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment