Skip to content

Instantly share code, notes, and snippets.

@macikokoro
Created August 2, 2014 06:31
Show Gist options
  • Save macikokoro/8f18b38c828a22a7be85 to your computer and use it in GitHub Desktop.
Save macikokoro/8f18b38c828a22a7be85 to your computer and use it in GitHub Desktop.
Accessing function expressions arrays.
var puzzlers = [
function ( a ) { return 8*a - 10; },
function ( a ) { return (a-3) * (a-3) * (a-3); },
function ( a ) { return a * a + 4; },
function ( a ) { return a % 5; }
];
alert( puzzlers[ puzzlers[1](3) ]( puzzlers[3](9) ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment