Skip to content

Commit 6c72df8

Browse files
committed
fix/ refactor
1 parent 3530f26 commit 6c72df8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

13_factorial/solution/factorial-solution.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const factorial = function(n) {
66
if (/[-.]/.test(n + '')) return;
77

88
// +n converts n to a number
9-
if (+n === 0 || +n === 1) return 1;
9+
if (+n === 0) return 1;
1010
return n * factorial(n - 1);
1111
};
1212

1313
// Do not edit below this line
14-
module.exports = factorial;
14+
module.exports = factorial;

0 commit comments

Comments
 (0)