Search code examples
javascriptgoogle-chromegoogle-chrome-devtoolschrome-debugging

Chrome debugger - how to go to next line without entring in function?


For example:

const x = 10
const f1 = () => {/* do something... */}
f1() // <<-- I'm here
console.log(x) // I want to go here without entring to f1 AT ALL but still let f1 execute.

I want to let f1 execute but I don't want to go over it.

Is it possible?


No duplication:

The other question is for finding a way to prevent any line from executing while this question is about letting lines that the only function calls execute but without the debugger to step into their execution.


Solution

  • As Ivar mentioned in the comments, the Step Over button does exactly what you want.

    In the GIF below you can see that I'm paused on doStuff(). I haven't executed it yet. After clicking Step Over I'm paused on the line of code below doStuff(). The three console.log() statements defined within doStuff() have been logged to the Console. Therefore, the doStuff() function has executed without you needing to step through every single line of the function.

    demo

    See Step through code to learn more about each of the code stepping buttons.