We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3530f26 commit 6c72df8Copy full SHA for 6c72df8
13_factorial/solution/factorial-solution.js
@@ -6,9 +6,9 @@ const factorial = function(n) {
6
if (/[-.]/.test(n + '')) return;
7
8
// +n converts n to a number
9
- if (+n === 0 || +n === 1) return 1;
+ if (+n === 0) return 1;
10
return n * factorial(n - 1);
11
};
12
13
// Do not edit below this line
14
-module.exports = factorial;
+module.exports = factorial;
0 commit comments