/dev tips

🎊   The Modern DevTools course has now started! Visit ModernDevTools.com to find out more   🎊

(45) Run the highlighted code block Next occurrence shortcut (47)

Chrome DevTools: Set a breakpoint based on a certain condition

3 Jun 2015
Set a breakpoint based on a certain condition

When you set a breakpoint, you can make it conditional based on the result of an expression. Right click on the line gutter and select Add Conditional Breakpoint and enter your expression.

If you have a callback like:

function callback(result, err) {
    //set a conditional breakpoint based on the existence of err
}

You could set a conditional breakpoint based on the existence of err.

Sign up to receive a developer tip, in the form of a gif, in your inbox each week.