Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/marijnh/Eloquent-JavaScript
/ factorial
Function
factorial
code/intro.js:22–28 ·
view source on GitHub ↗
(n)
Source
from the content-addressed store, hash-verified
20
}
21
22
function
factorial(n) {
23
if
(n == 0) {
24
return
1;
25
}
else
{
26
return
factorial(n - 1) * n;
27
}
28
}
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected