Reading 10 Error Handling & Debugging
-
Error Hnadling and Debugging 449 - 486
- The console log helps narrow down the area in whicl the error is located
- Exectution contex has 2 stages and stacks, you will likely understand and more likely to find the errors in your code.
- Debugging is the process of finding errors, it invloves a process of deduction
- JS has 7 different types of errors, each creates its own error object which can tell the line and number and also a descripton of the error. Somestimes also shes suggections
- If you might have an error you can use the try, catch, finally statemts.
- try { = try to execute this code , catch { if there is an exception run this code, finally { = this always get executed
- The stack -JS processes one line at a time, when a statement needs data from another function it stacks the new function ontop of the current task. eah time a new iten is added to the stack it creates a new execuition content
- Each time a scriipt enters a new execution context there are two phases of activity, 1Prepare = new scope created, vars,functions, aarguments created. 2 execute = assign values to vars, reference functions and envoke
Things I want to learn more about
- I am actually really interested in debugging. I like code that has a rules to follow. I am not so much into CSS because I feel you need an eye for it and its very opinionated vs JS rules and bugs.
Java Script & Jquery, Jon Duckett