Create ex5

This commit is contained in:
LSvekis
2021-06-28 17:04:07 -04:00
committed by GitHub
parent 54c7b50640
commit 7562c24806
+17
View File
@@ -0,0 +1,17 @@
function calcFactorial(nr) {
if (nr === 0) {
return 1;
} else {
return nr * calcFactorial(--nr);
}
}
console.log(calcFactorial(7));