8000 Fix return value of recursive factorial function · cotrones/javascript-exercises@b030e9a · GitHub
[go: up one dir, main page]

Skip to content

Commit b030e9a

Browse files
authored
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!
1 parent b14ac4e commit b030e9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

calculator/calculator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function recursiveFactorial(n) {
3333
if (n===0){
3434
return 1;
3535
}
36-
return n * factorial (n-1);
36+
return n * recursiveFactorial (n-1);
3737
}
3838

3939
module.exports = {

0 commit comments

Comments
 (0)
0