I often see the "Call stack" in many articles. like this: https://hackernoon.com/understanding-js-the-event-loop-959beae3ac40#ec22
But can't find the "call stack" in the ECMAScript document.
Is "Call stack" the same as "Execution context stack"?
Execution stack, also known as “calling stack” in other programming languages, is a stack with a LIFO (Last in, First out) structure, which is used to store all the execution context created during the code execution.
Whenever the JavaScript engine receives a script file, it first creates a default Execution Context known as the Global Execution Context (GEC) . The GEC is the base/default Execution Context where all JavaScript code that is not inside of a function gets executed. For every JavaScript file, there can only be one GEC.
A call stack is a mechanism for an interpreter (like the JavaScript interpreter in a web browser) to keep track of its place in a script that calls multiple functions — what function is currently being run and what functions are called from within that function, etc.
In computer science, a call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, program stack, control stack, run-time stack, or machine stack, and is often shortened to just "the stack".
Сall Stack and Execution Stack are different names for the same thing. It is a LIFO stack that is used to store execution contexts created during code execution.
Wikipedia says: "This kind of stack is also known as an execution stack, program stack, control stack, run-time stack, or machine stack" https://en.wikipedia.org/wiki/Call_stack
One more quote: "In reality, the JavaScript engine creates what’s called an “Execution Stack” (also known as the “Call Stack”)." https://tylermcginnis.com/ultimate-guide-to-execution-contexts-hoisting-scopes-and-closures-in-javascript/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With