I'm working with some javascript code and I'd love to be able to get an interactive console running in the context of a function call - that is, basically exactly what python's import pdb; pdb.set_trace()
accomplishes. Is there any way to do this? If not, what's the best approximation out there?
I'm currently using Chrome's console to mess around with things, and I'd basically love to be dropped into the middle of a function call and use Chrome's console to poke around the local variables and such.
Set a breakpoint, and Chrome's Inspector will allow you to inspect your app's state.
Click the line number. A blue marker will appear. Execution will pause when you hit that line.
Write a debugger
statement in your code. The Inspector will pause when you hit the statement.
function something() {
// do stuff
debugger;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With