Fix return value of recursive factorial function

While the previous return functioned the same (because it was calling another factorial function), it was not recursive. All credit still to ThirtyThreeB, just thought this might confuse some people and was worth fixing!
This commit is contained in:
bchalman 2018-08-19 13:02:55 -07:00 committed by GitHub
parent b14ac4ea17
commit b030e9a66b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,7 @@ function recursiveFactorial(n) {
if (n===0){
return 1;
}
return n * factorial (n-1);
return n * recursiveFactorial (n-1);
}
module.exports = {