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 b7ef53c commit dce5251Copy full SHA for dce5251
Recursive/Factorial.js
@@ -13,12 +13,12 @@ const factorial = (n) => {
13
throw new TypeError('Not a Number')
14
}
15
16
- if ((n % 1) !== 0) {
+ if (!Number.isInteger(n)) {
17
throw new RangeError('Not a Whole Number')
18
19
20
if (n < 0) {
21
- return new RangeError('Not a Positive Number')
+ throw new RangeError('Not a Positive Number')
22
23
24
if (n === 0) {
0 commit comments