Skip to content

Instantly share code, notes, and snippets.

@DavidStrada
Last active December 17, 2015 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidStrada/f3bdf6ef6dfbc74d35e0 to your computer and use it in GitHub Desktop.
Save DavidStrada/f3bdf6ef6dfbc74d35e0 to your computer and use it in GitHub Desktop.
var callback = [];
for(var i =0; i < 5; i++) {
callback.push( ( i => {
return () => {
console.log(i)
}
})(i) );
}
callback.forEach(cb => {
console.log( cb() );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment