我有一个简单的 js 文件,它会连续打印日期。
我正在使用 Google Chrome 调试器工具 (F12)
我的问题是,是否可以在 Google Chrome 中设置条件断点??
在我的代码中,如果秒值等于 50,我想设置一个断点??
s = date.getSeconds();
This是我的来源所在的 jsfiddle
(不确定为什么它在 jsfiddle 中不起作用)
无论如何,我的问题是,是否可以在 chrome 调试器工具中设置条件断点??
最佳答案
是的,这是可能的。
右键单击断点标记并选择“编辑断点...”,您可以在那里设置条件。
来自 Chrome Developer Tools on Breakpoints在 developers.google.com(强调我的):
Note: All the breakpoints you have set appear under Breakpoints in the right-hand sidebar. Clicking on the entry jumps to the highlighted line in the source file. Once you have a breakpoint set, right click on the blue tag breakpoint indicator to set a conditional statement for that breakpoint. Type an expression and the breakpoint will only pause only if the condition is true.
关于JavaScript :How to set a Conditional Break Point in Chrome debugger tools,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14598561/