Readings: In memory storage
The JavaScript engine (which is found in a hosting environment like the browser), is a single-threaded interpreter comprising of a heap and a single call stack. The browser provides web APIs like the DOM, AJAX, and Timers.
Understanding the JavaScript Call Stack
- What is a ‘call’?
a function invocation (call)
a function() execution
- How many ‘calls’ can happen at once?
one at a time, from top to bottom
- What does LIFO mean?
Last In, First Out (LIFO)
- Draw an example of a call stack and the functions that would need to be invoked to generate that call stack.
![](/reading-notes/call_stack.png)
- What causes a Stack Overflow?
The stack overflow error is often caused by an infinite loop or the creation of variables larger than the size of the call stack.
JavaScript error messages
- What is a ‘reference error’?
This is as simple as when you try to use a variable that is not yet declared you get this type os errors.
- What is a ‘syntax error’?
when you have something that cannot be parsed in terms of syntax
- What is a ‘range error’?
Try to manipulate an object with some kind of length and give it an invalid length and this kind of errors will show up
- What is a ‘tyep error’?
the types (number, string and so on) you are trying to use or access are incompatible,
Flike accessing a property in an undefined type of variable.
- What is a breakpoint?
breakpoint, which will make your program stop at that point only if a condition is met.
- What does the word ‘debugger’ do in your code?
The debugger keyword is used in the code to force stop the execution of the code at a breaking point and calls the debugging function.