Google Chrome Developer Tools: Debugging JavaScript

Google Chrome · 50K views · 2009 · 0:40

Open on YouTube

Testing, debugging & developer toolsWeb developmentdemodated

Why Stack Overflow recommends it

Stack Overflow users link it when answering JavaScript questions where the asker needs to step through code or inspect variables in Chrome instead of guessing at the cause of an error.

Recommended by 4 people across 4 different months, 2010 to 2014.

What it is

A very short official clip from the Google Chrome channel showing how to use Chrome's built-in developer tools to debug JavaScript. It is a brief demo of the debugger, breakpoints and inspection, with a link to the Chromium devtools documentation.

What people said

Recommends Cymen · 2012-11 · Stack Overflow · on “Backbone add remove from UL anomaly”

You should google for more information -- there are some Youtube videos that are helpful like thes: [LINK] and [this video]

Recommends katspaugh · 2012-12 · Stack Overflow · on “Javascript Module Pattern confusion”

You know what the console is, that's good. Now, to make a step further, your console should have this "Break on all exceptions" button, which would let you inspect your code in runtime (it's called debugging). Try to look at the call stack to see what's really happening. [this video]

Recommends Cory Danielson · 2013-05 · Stack Overflow · on “TypeError: Cannot call method 'replace' of null - Backbone.js”

You need to drill a little deeper. Try commenting out individual lines in LibraryView until the error goes away. Once you've identified the exact line the causes the error you can probably fix it quite easily. Or use a debugger if you're familiar with that. [this video]

Recommends JayD · 2014-12 · Stack Overflow · on “HTML/javascript TypeError when using document.getElementById even though ID's are declared”

Use chrome debugging, you can see all your variables/values and exactly whats happening. I think its breaking because your data isnt get passed through, or unexpected data is being passed through. [this video]

Cites IsmailS · 2010-06 · Stack Overflow · on “vs2010: trying to debug javascript using Chrome: this is not a valid location for a breakpoint”

You can debug javascript within chrome alone. See this How do you launch the JavaScript debugger in Google Chrome? [LINK] [this video] [LINK] [LINK]