Created
March 3, 2018 16:05
-
-
Save realgio95/545d81f349b53bed1e83857a969612e0 to your computer and use it in GitHub Desktop.
YaadCode - Live FreeCode Camp Coding Sessions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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