DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

Recursion — Example 93

Quick explanation + ready code for: Recursion.

Shen Recursion Back to examples
Back to language
Syntax: Recursion in Shen. ID: #93

Code

function fact(n){ return n<=1?1:n*fact(n-1); }
console.log(fact(6));

Notes

You can copy this snippet and adapt it. For advanced, add real-world inputs, edge cases, and tests.