Remove live code & console.log, leave examples as comments (ProjectEuler, Recursive).

This commit is contained in:
Eric Lavault
2021-10-10 18:18:25 +02:00
parent 9212e6d684
commit 5f45b540b9
17 changed files with 48 additions and 98 deletions

View File

@ -3,14 +3,9 @@
// 5! = 1*2*3*4*5 = 120
// 2! = 1*2 = 2
const factorial = (n) => {
export const factorial = (n) => {
if (n === 0) {
return 1
}
return n * factorial(n - 1)
}
// testing
console.log(factorial(4))
console.log(factorial(15))
console.log(factorial(0))