We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent beda5d4 commit ee9e849Copy full SHA for ee9e849
4-for-loop/04-factorial.js
@@ -0,0 +1,11 @@
1
+//04. Factorial
2
+
3
+function factorial(n) {
4
+ n = Number(n);
5
+ let total = 1;
6
+ for (let i = 1; i <= n; i++) {
7
+ total *= i;
8
+ }
9
+ console.log(total);
10
+}
11
+factorial(8);
0 commit comments