Skip to content

Instantly share code, notes, and snippets.

@realgio95
Created March 3, 2018 16:05
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 realgio95/545d81f349b53bed1e83857a969612e0 to your computer and use it in GitHub Desktop.
Save realgio95/545d81f349b53bed1e83857a969612e0 to your computer and use it in GitHub Desktop.
YaadCode - Live FreeCode Camp Coding Sessions
/*
Sign up for YaadCode - Live FreeCode Coamp Coding Sessions Twice Weekly on Skype
You may join the FreeCodeCamp, Kingston Group here: https://www.facebook.com/groups/free.code.camp.kingston.jamaica/
https://www.freecodecamp.org/challenges/factorialize-a-number
*/
function factorialize(num) {
if (num ==1 ){
return 1;
}
if (num ==0) {
return 1;
}
return num * factorialize(num-1);
}
factorialize(5); //Expected Output: 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment