Created
April 27, 2015 10:03
-
-
Save mrsum/2197f9caf1519b4e89bf to your computer and use it in GitHub Desktop.
crazy dfd
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 index, promise, _i; | |
for (index = _i = 0; _i < 10; index = ++_i) { | |
promise = (function(index) { | |
var dfd; | |
dfd = new $.Deferred(); | |
setTimeout(function() { | |
log(index); | |
return dfd.resolve(); | |
}, 1000); | |
return dfd.promise(); | |
})(index); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment