We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d6d726 commit 1d208edCopy full SHA for 1d208ed
recursiveFactorial.js
@@ -0,0 +1,11 @@
1
+function factorial (n){
2
+ if(n == 0){
3
+ return 1;
4
+ }
5
+ else{
6
+ return n * factorial(n-1);
7
8
+}
9
+const result = factorial(10);
10
+console.log(result);
11
+//output 3628800
0 commit comments