Skip to content

Instantly share code, notes, and snippets.

@ikr
Created February 18, 2011 11:54
Show Gist options
  • Save ikr/833582 to your computer and use it in GitHub Desktop.
Save ikr/833582 to your computer and use it in GitHub Desktop.
var factorial = function f(n) {
return (n? n * f(n - 1) : 1);
};
var originalFactorial = factorial;
factorial = function() { return 0; };
print(originalFactorial(5)); // 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment