JavaScript uses an execution context stack to manage function calls. It starts with the global context; calling a function adds a frame, and returning removes it in last-in, first-out order. section 7.1
Each frame records a scope chain, variable object, and this value. Local variables and parameters make frames larger, while the scope chain links a function to its parent context and ultimately to the global context. section 7.1
Nested calls
When logger is invoked, JavaScript pauses the global context and activates logger’s frame. After logger returns, its frame is popped and the global context resumes. Nested functions, currying, and recursion add more frames and can increase stack use.







