Skip to content

Instantly share code, notes, and snippets.

@mhayashi
Created November 4, 2010 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mhayashi/662190 to your computer and use it in GitHub Desktop.
Save mhayashi/662190 to your computer and use it in GitHub Desktop.
var sub = function(i) {
return function(cb) {
// do something
cb && cb(i);
};
};
for (var i = 0, len = array.length; i < len; i++) {
sub(i)(function(j) {
// do something
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment