reading-notes

Javascript Debugging

execution context

  1. global context - code that is in a script, but not in a function. there is only one global context in any page.

  2. Function Context - code that is being run within a function has its own function context

  3. eval context text is executed like coed in an internal function called eval()

Variable Scope

  1. function-level scope
    • when a variable is declared within a function, it can only be used within that function. this is because it has function level scope

The Stack

  1. when a statement has to call some other code in order to do its job, the new task goes to the top
  2. once the new task has been performed, the interpreter can go back to the task at hand
  3. each time a new item is added to the stack it creates a new execution content
  4. variables defined in a function are only avvaible in that function