mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
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:
@@ -33,7 +33,7 @@ function recursiveFactorial(n) {
|
||||
if (n===0){
|
||||
return 1;
|
||||
}
|
||||
return n * factorial (n-1);
|
||||
return n * recursiveFactorial (n-1);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user