mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-11 22:48:01 -05:00
16 lines
222 B
TypeScript
16 lines
222 B
TypeScript
//! test_output(120)
|
|
|
|
export default function main() {
|
|
const one = 1;
|
|
|
|
function factorial(n: number): number {
|
|
if (n === 0) {
|
|
return 1;
|
|
}
|
|
|
|
return n * factorial(n - one);
|
|
}
|
|
|
|
return factorial(5);
|
|
}
|