Created
October 15, 2015 04:07
-
-
Save platypusrex/db69769359193053d276 to your computer and use it in GitHub Desktop.
Javascript - Factorialize any number
This file contains hidden or 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
function factorialize(num) { | |
if(num === 0){ | |
return 1; | |
} | |
return num * factorialize(num - 1); | |
} | |
factorialize(5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment