Created
June 15, 2017 21:11
-
-
Save OneCent01/ded83157888af0f37ef020bc66615a37 to your computer and use it in GitHub Desktop.
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
var factorial = function(n) { | |
if(n < 0) {return null}; | |
var result = 1; | |
if(n > 0) { | |
result = result * n * factorial(n - 1); | |
} return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment