Created
May 5, 2016 11:03
-
-
Save jspc/73afd857d422e2724b4220a4f7c7691f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var main = function(m, x, y){ | |
{ | |
foo: bar, | |
baz: quux | |
}[m](x,y); | |
} | |
var bar = function(x,y){ | |
// do something | |
} | |
var quux = function(x,y){ | |
// do something else | |
} | |
main('foo'); | |
main('baz'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment