Skip to content

Instantly share code, notes, and snippets.

@cho45
Forked from mhayashi/gist:662190
Created Nov 4, 2010
Embed
What would you like to do?
var sub = function (i) {
var a = arguments;
return function(cb) {
cb && cb.apply(null, a);
};
};
var array = [1, 2, 3];
for (var i = 0, len = array.length; i < len; i++)
sub(array[i], i)(function(item, index) { console.log(item, index);});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment