Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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