Skip to content

Instantly share code, notes, and snippets.

@ecounysis
Created April 4, 2011 00:06
Show Gist options
  • Save ecounysis/900957 to your computer and use it in GitHub Desktop.
Save ecounysis/900957 to your computer and use it in GitHub Desktop.
var callback = function(msg) {
alert(msg);
}
var funcList = [];
var vals = ['do', 're', 'mi'];
for(var m in vals) {
funcList[m] = function() {
callback(m);
}
}
for(var f in funcList) {
funcList[f]();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment