Skip to content

Instantly share code, notes, and snippets.

@ryardley
Created July 26, 2016 03:30
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 ryardley/fb9d87738965d7cf7e73d0e28a0c4ef4 to your computer and use it in GitHub Desktop.
Save ryardley/fb9d87738965d7cf7e73d0e28a0c4ef4 to your computer and use it in GitHub Desktop.
function one(){
console.log('do one');
}
function two(){
console.log('do two');
}
function three(){
console.log('do three');
}
function runFunc(name) {
return {
one,
two,
three,
}[name]();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment