Error Handling and Debugging

The web site hold my reading notes in code 201.

Error Handling and Debugging


follw process

  1. The greeting variable gets its value from the greetUser() function.
  2. greetUser() creates the message by combining the string ‘He 11 o ‘ with the result of getName ().
  3. getName () returns the name to greetUser().
  4. greetUser() now knows the name, and combines it with the string. It then returns the message to the statement that called it in step 1.
  5. This greeting variable is written to an alert box.

Variable Scop :scope is function-based while context is object-based. In other words, scope pertains to the variable access of a function when it is invoked and is unique to each invocation. Context is always the value of the this keyword, which is a reference to the object that “owns” the currently executing code.

Browser support: Represents a run-time error caused by a script operation. JavaScript interpreters throw an Error object, when a script error (exception) occurs. In some cases when the error is caused by a DOM operation, JavaScript interpreters throw an DOMException object, not an Error object.

example

common error 1. Uncaught TypeError: Cannot read property. … 2. TypeError: ‘undefined’ is not an object (evaluating. … 3. TypeError: null is not an object (evaluating. … 4. (unknown): Script error. … 5. TypeError: Object doesn’t support property. … 6. TypeError: ‘undefined’ is not a function.

Back to homw page