Set a breakpoint based on a certain condition

Published on Updated on

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.

Updated on Improve article

Back

Select and execute a block of code in the Sources Panel

Next

Quickly cycle through the DevTools panels

This site uses cookies to deliver and enhance the quality of its services and to analyze traffic. If you agree, cookies are also used to serve advertising and to personalize the content and advertisements that you see. Learn more about our use of cookies.