Debugging: Becoming a Bug Detective

Errors aren't failures. They're clues. Eleven short pages from Summer School of Summer School, about 18 minutes of reading in all.

What you’ll learn

  • Where the word \

The pages

Eleven pages, about 18 minutes.

  1. Bugs Happen (to Everyone) Let's start with a story. It's 1947, at Harvard University. A team of engineers is working with a gigantic early…
  2. The Three Kinds of Bugs Bugs come in three main flavors, from easiest to hardest to catch. A syntax error means you broke JavaScript's grammar…
  3. Meet the Error Family When JavaScript hits a problem it can't handle, it creates an error (sometimes called an exception). Errors come in…
  4. Reading an Error Message Error messages look intimidating at first, with their red text and strange words. But once you know how to read them…
  5. console.log: Your Flashlight The most popular debugging tool in the world is also the simplest: console.log. When your code isn't doing what you…
  6. The Debugger: Pausing Time console.log is great, but sometimes you want superpowers. What if you could freeze time in the middle of your program…
  7. Handling Errors with try...catch Some errors are bugs that you need to fix. But some errors are things you can predict might go wrong, even in perfect…
  8. Throwing Your Own Errors You can also create errors yourself, using throw. This is useful when someone uses your function in a way that doesn't…
  9. Rubber Duck Debugging Here's a debugging technique that sounds like a joke, but genuinely works. It was popularized by a famous programming…
  10. The Top 12 Beginner Bugs Here's Buggsy's personal greatest hits collection. When something isn't working, run through this checklist. The…
  11. Recap The key ideas of Summer School, Debugging JavaScript, on one page. A bug is a mistake that makes a program behave…

Reading is step one

CurlyScript turns these notes into a game: short questions, an explanation after every answer, and a test at the end of each grade. Free, with nothing to sign up for.

Start learning