![Umar Hansa](https://web.dev/images/authors/umarhansa.jpg) Umar Hansa [X](https://twitter.com/umaar) [Homepage](https://umaar.com/)

<br />

![Set a breakpoint based on a certain condition.](https://developer.chrome.com/static/blog/set-a-breakpoint-based-on-a-certain-condition/image/set-breakpoint-based-a-d83a98122329b.gif)

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:

```javascript
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`.