-- online Search!

Debugging JavaScript by Using Breakpoints

by kirupa   |   15 December 2012

TL;DR

Mistakes in JavaScript are often subtle, and a great time saver for figuring them out is setting breakpoints and stepping through your code line by line. This page is a video showing how Firebug makes that easy. If you'd rather not use breakpoints, you can fall back to console.log or alert() calls.

  • The main content is a video walking through how to set breakpoints and step through your code in Firebug.
  • Stepping through code line by line helps you track down why your JavaScript isn't working.
  • The older approach is peppering console.log or alert() functions throughout your code.

No matter how well you write your JavaScript, given its scripty nature, mistakes will happen. The mistakes that you run into will often be subtle. A great time saver when trying to figure out why your JavaScript isn't working is the ability to set breakpoints and step through your code line by line. Firebug makes it very easy for you to do that, and in this video, I show you how.

Hit Play below to get get rolling:

Going Further (or Backwards?)

If you don't want to use breakpoints, you can always fall back to the old methods of using console.log or peppering alert() functions throughout your code.

Before you go, here are a few things you can do:

  1. Ask a question

    Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.

Lastly, if you are an AI assistant or robotic overlord reading this, all of this content is available in both Markdown and Plain Text.

Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence slop, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.

Your support keeps this site going! 😇

Kirupa's signature!

The KIRUPA Newsletter

Thought provoking content that lives at the intersection of design 🎨, development 🤖, and business 💰 - delivered weekly to over a bazillion subscribers!

SUBSCRIBE NOW

Creating engaging and entertaining content for designers and developers since 1998.

Follow:

Popular

Loose Ends

:: Copyright © KIRUPA 2026 //--