I’ve used printf debugging since forever and I always seem to solve my bugs faster that way.
Some cases calls for better tools so here are some gems that I’m sure you’ll find useful:
As I’ve mentioned before, you can use the “debugger;” statement to force a breakpoint in your code.
Need a conditional breakpoint? Just wrap it with an IF clause:
if (somethingHappens) {
debugger;
}
Just remember to remove these before going live.
Sometimes the DOM just gets a mind of its own. Weird changes take place and it’s hard to get to the source of the problem.
The Chrome Developer Tools has one super useful trick for debugging this. It’s called
Comments (0)
Sign in to post comments.