JavaScript › Event Loop & Concurrency

What is the call stack?

Beginner

Answer

The call stack tracks which function is currently executing and what called it, growing with each function call and shrinking as functions return — a 'stack overflow' happens when it grows too deep, usually from unbounded recursion.
function a() { b(); }
function b() { c(); }
function c() { console.log('deepest'); }
a(); // stack: a -> b -> c, then unwinds
Real-world example Reading a stack trace in an error to see the exact chain of function calls that led to a crash.

Common follow-ups: What causes a 'Maximum call stack size exceeded' error?