Skip to content

Instantly share code, notes, and snippets.

@cho45
Forked from mhayashi/gist:662190
Created November 4, 2010 06:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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