MCPcopy Index your code
hub / github.com/Open-Bootcamp/JavaScript-Basico / factorial

Function factorial

sesion-10-modulos/detalles.js:1–8  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

1function factorial(a) {
2 // Factorial de 5: 5 * 4 * 3 * 2 * 1
3 let factorial = 1;
4 for (let i = 2; i <= a; i++) {
5 factorial *= i;
6 }
7 return factorial;
8}
9
10console.log(factorial(10))

Callers 2

index.jsFile · 0.70
detalles.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected