Skip to content

Instantly share code, notes, and snippets.

@skeggse
Created September 27, 2013 21:24
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 skeggse/6735391 to your computer and use it in GitHub Desktop.
Save skeggse/6735391 to your computer and use it in GitHub Desktop.
function factorial(n) {
if (n == 0)
return 1;
return n * factorial(n - 1);
}
function factorialb(n) {
var b = 1;
while (n)
b *= n--;
return b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment