A ‘call’ is essentially the invocation of a function execution.
‘Calls’ can happen one at a time, from top to bottom, making it synchronous.
Last in First out.
This means that the last function that gets pushed into the stack is the first to be popped out, when the function returns.
const function1 = () => {
console.log('im f1')
}
const function2 = () -> {
function1();
console.log('im f2')
}
A stack overflow occurs when there is a recursive function (a function that calls itself) without an exit point. The browser (hosting environment) has a maximum stack call that it can accomodate before throwing a stack error.
This is as simple as when you try to use a variable that is not yet declared you get this type os errors.
This occurs when you have something that cannot be parsed in terms of syntax, like when you try to parse an invalid object using JSON.parse.
This error happens when we try to manipulate an object with some kind of length and give it an invalid length.
This type of errors shows up when the types (number, string and so on) you are trying to use or access are incompatible, like accessing a property in an undefined type of variable.
It is a point in your code that you can set where you can see what happened in the code before that point.
It can be used to set a break point in your code in the line that you put the keyword ‘debugger’
Using debugger more efficiently
Understanding the call stack more and how to rememdy stack overflow errors
References
The JavaScript Call Stack - What It Is and Why It’s Necessary