Understanding the JavaScript Call Stack
Draw an example of a call stack and the functions that would need to be invoked to generate that call stack. -
function firstFunction(){
throw new Error('Stack Trace Error');
}
function secondFunction(){
firstFunction();
}
function thirdFunction(){
secondFunction();
}
thirdFunction();
What causes a Stack Overflow? - 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.