admin管理员组文章数量:1323323
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()
acplishes. 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.
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()
acplishes. 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.
Share asked Aug 29, 2012 at 18:37 ClaudiuClaudiu 230k173 gold badges503 silver badges699 bronze badges 02 Answers
Reset to default 7Set 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; }
You can set breakpoints in chrome developers tool as well as firebug in firefox and developer tool in ie 8 and above..
本文标签: javascript interactive debugging (equivalent of python39s pdbsettrace())Stack Overflow
版权声明:本文标题:javascript interactive debugging (equivalent of python's pdb.set_trace()) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742141657a2422605.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论