Skip to content

Instantly share code, notes, and snippets.

@brbcoding
Created July 22, 2015 19:43
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 brbcoding/a6e7757aa5a16ef8582f to your computer and use it in GitHub Desktop.
Save brbcoding/a6e7757aa5a16ef8582f to your computer and use it in GitHub Desktop.
var fns = [foo, bar];
var entry = {};
entry.statusId = 0;
function foo() {
console.log('foo');
}
function bar() {
console.log('bar');
}
fns[entry.statusId](); // foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment