JavaScript Ch. 10 - Error Handling and Debugging
Execution Context
-
Global Context: Code that is in the script, but not in a function
-
Function Context: Code that is being run within a function
-
Eval Context (Not Shown): Text is executed like code in an internal function called eval()
Debugging is the process of finding errors through deduction.
If a JavaScript statement generates an error, then it throws an exception
-
Details of Error Objects can be found on pg. 459-461
-
When dealing with errors, you can use the try, catch, finally statements to handle it gracefully and give users helpful feedback.
Pg. 485 lists many common errors that may cause issues when writing script