Code 301: Class 10 - The Call Stack
- Call Stack mechanism for the interpreter to keep track of its place in a script that calls multiple functions
- Functions are added to the call stack in the order that they are invoked, as functions are executed they are removed from the call stack until the stack is empty at which all script has been run.
- If the number of function calls exceed the space limit allotted to it, it will result in an “stack overflow” error
- JavaScript is single threaded
- Call stack operates on the LIFO inventory method
- Code execution is synchronous
- Reference error using a variable that is not yet defined
- Syntax error when you have something that cannot be parsed in terms of syntax
- Range error if you try to manipulate an object with some kind of length and give ti an invalid length
- Type error when the types of variables that you are trying to use or access are incompatible
- Debugging
console.log();
debugger;
- Right clicking a breakpoint and setting a more specific break instance
console.trace();
try
and catch
*allows you catch errors for future debugging and provide a default value to continue running the remaining code
- quokka code editor extension that displays live variable values
- This reference doc contains a list of many of the standard JavaScript errors with links to in depth descriptions
Return to reading-notes Deployed Site
Return to reading-notes Mark Down