Add code for chapter 3 and 4 in ts (#103)

This commit is contained in:
Alex
2019-03-28 23:51:36 +02:00
committed by Aditya Bhargava
parent 97003f16df
commit d77cde9e67
8 changed files with 94 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
function fact(x: number): number {
if (x === 1) {
return x;
}
return x * fact(x - 1);
}
console.log(fact(5));