Created
September 6, 2017 04:39
-
-
Save goofmint/95a02b15ae4cac4a43d5b140aba43246 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(res, rej) { | |
function loop(i) { | |
return new Promise(function(resolve, reject) { | |
setTimeout(function() { | |
console.log(i); | |
resolve(i+1); | |
}, 100); | |
}) | |
} | |
loop(0); | |
}).then(function() { | |
console.log("Finish"); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment