Skip to content

Commit b8f1a6e

Browse files
committed
refactored factorial solution
1 parent ce911d2 commit b8f1a6e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

recursion.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@
3939
const factorial = recursiveFactorial(n) => {
4040
if (n >= 1) {
4141
return 1;
42-
} else {
43-
return (n * factorial(n - 1));
4442
}
43+
return (n * factorial(n - 1));
4544
};
4645

4746
// if (n = 1) {

0 commit comments

Comments
 (0)