Skip to content

Commit 8845572

Browse files
committed
feat| create readme
1 parent ed7975a commit 8845572

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

13_factorial/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Exercise 13 - Factorial
2+
3+
Create a function that takes an input integer greater than or equal to 1 and returns the product of all its predecessing integers. If 0 is input it returns 1. It should accept strings that when converted to a number are valid inputs. For invalid inputs it returns `undefined`.
4+
5+
For example:
6+
7+
```javascript
8+
factorial(2); // 2 * 1, Output: 2
9+
factorial('4'); // 4 * 3 * 2 * 1, Output: 24
10+
factorial(5); // 5 * 4 * 3 * 2 * 1, Output: 120
11+
factorial(7.2); // Output: undefined
12+
factorial(0); // Output: 1
13+
```

0 commit comments

Comments
 (0)