Created
February 4, 2020 18:09
-
-
Save danielnieto/134ccfb1ec7f18377425eb3b91afcea0 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
function foo(){ | |
return Promise.resolve('resuelta') | |
} | |
for (var i=0; i<10; i++) { | |
(function(){ | |
var index = i; | |
foo().then(function(){ | |
console.log(index) | |
}) | |
})() | |
} |
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
function foo(){ | |
return Promise.resolve('resuelta') | |
} | |
for (var i=0; i<10; i++) { | |
foo().then(function(){ | |
console.log(i) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment