Class Ten Notes (301)
In Memory Storage
- A call is what the call stack is used for, a only one call can be executed at once
- LIFO is Last In, First Out (LIFO), the last function gets put insde the stack is the first to be popped out when the function returns
function firstFunction(){
console.log(“Hello from firstFunction”);
} //returns and prints, then popped off the stack and move on to the secondFunction()
function secondFunction(){
firstFunction();
console.log(“The end from secondFunction”);
} //calls and pushes firstFunction() into the stack
secondFunction(); //gets called first, create empty stack frame (entry point of the program)
- A stack overflow occurs when there is a recursive function (a function calls itself) without an exist point, which will exceed the browser(hosting environment)’s maximum stack call
JS Error Messages[^2]
- Reference Error: trying to use a variable that is not yet declared
- Syntax Errors: something that cannot be parsed due to syntax
- Range error: trying to manipulate an object with some kind of length and give it an invalid length
- Type error: the type is imcompatible to the action
- Breakpoint: Where you want to code to run
- a debugger statement in your code in the line you want to break
What is a ‘reference error’?
What is a ‘syntax error’?
What is a ‘range error’?
What is a ‘type error’?
What is a breakpoint?
What does the word ‘debugger’ do in your code?
Back to main page
References