shenkwen
shenkwen

Reputation: 3880

Is there a way to set breakpoints for every js line in the chrome dev tools?

I am quite new to javascript, I often find the need to walk through JS codes line by line to get better understanding how the code works. But manully setting breakpoints for each line in the 'source' panel of chrome is just too time-consuming, is there a way to do this automatically? In fact, in some very complicated projects, JS files are littered everywhere in the project folders, it is quite hard and troublesome to locate and open them all in the source panel. So is there a way to let chrome execute JS 1 line at a time, no matter which files the line is in?

Upvotes: 6

Views: 2450

Answers (2)

David Mays
David Mays

Reputation: 626

The accepted answer is to press F10, which steps over the next function call.

If you truly wish to step a single step at a time however, F9 is simply "step."

Upvotes: 0

Felix Guo
Felix Guo

Reputation: 2708

Once your code breaks, there's a button beside "resume script execution" called "step over next function call" or F10, which will resume step by step.

Upvotes: 5

Related Questions