Code 301 Class 09 Reading Notes
Understanding the JavaScript Call Stack
- What is a
call
A function invocation by used by the call stack. Since the call stack is single function(s) execution, is done, one at a time, from top to bottom. It means the call stack is synchronous. - How many
calls
can happen at once? One call can occur at once. - What does LIFO mean? Last In, First Out
- Draw an example of a call stack and the functions that would need to be invoked to generate that call stack.
- What causes a Stack Overflow It occurs when there is a recursive function (function that calls itself) without an exit point.
JavaScript error messages
- What is a ‘reference’ error? When you try to use a variable that is not yet declared.
- what is a ‘syntax error’? When you have something that cannot be parsed in terms of
syntax
. - What is a ‘range error’? When manipulating an object with some kind of length and git it an invalid length.
- What is a ‘type error’? When the types (number, string, etc) we are tyring to use or access are incompatible, like accessing a property in an undefined type of varable.
- what is a ‘breakpoint’? Can be achieved by putting a debugger statement in your code in the line you want to break.
- What does the word ‘debugger’ do in your code? Adding the statment when running the code above you can see the ‘history’ before reaching that breakpoint.
Things I want to know more about
I like the small add to help ‘debbug’, by adding the word debugger;
could help with helping find reference points that is causing the break.