reading-notes

Reading 10 - In Memory Storage

Source: The JavaScript Call Stack - What it is and why it’s necessary

Q1 What is a ‘call’?

A “call” is a function invokation

Q2 How many ‘calls’ can happen at once?

One

Q3 What does LIFO mean?

Last In, First Out

Q4 Draw an example of a call stack and the functions that would need to be invoked to generate that call stack.

[FunctionA] [FunctionB] [FuncitonC] [FunctionD]

FunctionA would need to be called first, followed by FunctionB then FunctionC then finally FunctionD

Q5 What causes a Stack Overflow?

A stack overflow occurs when a function calls itself without an exit point.

Source: JavaScript error messages and debugging

Q6 What is a ‘reference error’?

This is when you try to use a variable that is not yet defined

Q7 What is a ‘syntax error’?

This is when you have something that cannot be parsed in terms of syntax.

Q8 What is a ‘range error’?

This is when an invalid length is used

Q9 What is a ‘type error’?

This is when the types (number, string, etc.) are incompatable or undefined

Q10 What is a breakpoint?

A breakpoint is a point in the code where the debugger should pause or stop the execution of the program. This lets you see how (or if) the program is running up to that point.

Q11 What does the word ‘debugger’ do in your code?

A debugger statement lets you see the history before reaching the breakpoint, to see at which lines a function was called and with what arguments.