Skip to content

Instantly share code, notes, and snippets.

@mosfet1kg
Created December 3, 2015 14:05
Show Gist options
  • Save mosfet1kg/b254de81e01b6762bb3f to your computer and use it in GitHub Desktop.
Save mosfet1kg/b254de81e01b6762bb3f to your computer and use it in GitHub Desktop.
async + closure
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