reading-notes

Todd Wolden

View on GitHub

301 Class Ten Reading Notes “In memory storage”

The call stack is primarily used for function invocation (call). 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. The understanding of the call stack is vital to Asynchronous programming.

In Asynchronous JavaScript, we have a callback function, an event loop, and a task queue. The callback function is acted upon by the call stack during execution after the call back function has been pushed to the stack by the event loop. Last In, First Out (LIFO) principle to temporarily store and manage function invocation (call).

LIFO: When we say that the call stack, operates by the data structure principle of Last In, First Out, it means that the last function that gets pushed into the stack is the first to be pop out, when the function returns.

Questions

  1. What is a ‘call’? the invocation function is the call
  2. How many ‘calls’ can happen at once? just one at a time
  3. What does LIFO mean? Last In First Out
  4. Draw an example of a call stack and the functions that would need to be invoked to generate that call stack. Image Credit to
  5. What causes a Stack Overflow? This occurs when a function calls itself without an exit point. This is refered to as a recursive function
  6. What is a ‘reference error’? When you try to use a variable that is not yet declared.
  7. What is a ‘syntax error’? This occurs when you have something that cannot be parsed in terms of syntax.
  8. What is a ‘range error’? When you use an invalid length to manipulate an object
  9. What is a ‘type error’? when you are using the wrong data type to reference something
  10. What is a breakpoint? the line your code broke at
  11. What does the word ‘debugger’ do in your code? add a breakpoint

Resources

Return to the Table of Contents

Table of Contents