Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
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
1
function
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
10
console.log(factorial(10))
Callers
2
index.js
File · 0.70
detalles.js
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected