Skip to content

Instantly share code, notes, and snippets.

@aemkei
Created February 9, 2009 09:37
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 aemkei/60730 to your computer and use it in GitHub Desktop.
Save aemkei/60730 to your computer and use it in GitHub Desktop.
function memoizer(memo, fundamental) {
var shell = function (n) {
var result = memo[n];
if (typeof result !== 'number') {
result = fundamental(shell, n);
memo[n] = result;
}
return result;
};
return shell;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment