Chapter 10Testing and Debugging

Errors and bugs are a fact of life in programming―they will always be there. A ninja programmer will try to do everything to minimize errors occurring, and find ways to identify and deal with them quickly when they do occur.

In this chapter, we’ll cover these topics:

  • errors, exceptions, and warnings

  • the importance of testing and debugging

  • strict mode

  • debugging in the browser

  • error objects

  • throwing exceptions

  • exception handling

  • testing frameworks

  • our project―add exception handling and write tests for the Quiz Ninja application

Errors, Exceptions, and Warnings

Errors are caused when something goes wrong in a program. They are usually caused by one of the following:

  • system error―there is problem with the ...

Get JavaScript: Novice to Ninja now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.