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 a0fef1e commit ae3d6c3Copy full SHA for ae3d6c3
README.md
@@ -144,7 +144,8 @@ console.log(fibonacci(6)); // Output: 8
144
145
```js
146
function factorial(n) {
147
- if (n < 0) throw new RangeError('Factorial is not defined for negative numbers');
+ if (n < 0)
148
+ throw new RangeError("Factorial is not defined for negative numbers");
149
if (n === 0 || n === 1) return 1;
150
return n * factorial(n - 1);
151
}
0 commit comments