Created
December 3, 2015 14:05
-
-
Save mosfet1kg/b254de81e01b6762bb3f to your computer and use it in GitHub Desktop.
async + closure
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 _ = require('underscore'), | |
async = require('async'); | |
var funcs = []; | |
for(var i=0; i<56; i++){ | |
funcs.push( | |
(function(index){ | |
return function(cb){ | |
cb(null, index); | |
} | |
})(i) | |
); | |
} | |
async.parallel( funcs, function(err, results){ | |
console.log(results); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment