Skip to content

Commit 7a889e2

Browse files
author
iamvalentin23
committed
Add factorial problem
1 parent b52001e commit 7a889e2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/_Problems_/factorial/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function factorial(num) {
2+
if (num === 1) return num;
3+
else return num * factorial(num - 1);
4+
}
5+
6+
module.exports = {
7+
factorial,
8+
};

0 commit comments

Comments
 (0)