Chapter 6: Errors and Debugging

Learning Objectives

Upon completion of this chapter, you should be able to do the following:

  1. Describe how to debug programs using console.log
  2. Explain the three common error types: syntax error, runtime error, logic error
  3. Give examples of each of the three common error types
  4. Explain some best practices to avoid errors and debugging
  5. Explain how ReferenceError and SyntaxError may occur, with examples

Key Terminology

While reading this chapter, you will notice the following key terms listed by the page they first appear on. As you read, you should make note of the definitions of these terms.

What is Debugging?

  1. bugs
  2. debugging
  3. syntax errors
  4. runtime errors
  5. logic errors

Categories of Errors

  1. parsing stage
  2. execution stage
  3. syntax
  4. exceptions

Diagnosing Error Messages

  1. token
  2. syntax highlighting

Error Types

  1. error type
  2. built-in object

Chapter Content