Skip to content

Instantly share code, notes, and snippets.

@thetallweeks
Last active December 26, 2015 12:19
Show Gist options
  • Save thetallweeks/7149775 to your computer and use it in GitHub Desktop.
Save thetallweeks/7149775 to your computer and use it in GitHub Desktop.
Coderbyte Factorial function
function FirstFactorial(num) {
var factorial = 1;
// code goes here
for(i = 2; i <= num; i++) {
factorial *= i;
}
return factorial;
}
// keep this function call here
// to see how to enter arguments in JavaScript scroll down
FirstFactorial(readline());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment