Recursion & Call Stack Playground

Every faktorial call adds a floor to a Gang Kenari house with its own n, the base case answers, then the answers come down floor by floor to the neighbourhood…

Why it matters

Recursion is at the heart of walking trees (the DOM, folders, nested JSON), and “why a stack overflow” stays a mystery while its flow is invisible. Watching the floors go up and come off, and the base case, means understanding when and why recursion works, or blows up.

The key idea

Recursion stacks up first, then answers its way down

Common mistakes

Try it in this playground