Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
考虑到我有 100 行代码并且我希望在每一行都设置断点,是否有类似单击第一行向下滚动到第 100 行并使用 shift-click 或 control-click 来选择其间的所有行以应用断点?
在 chrome 中,您可以尝试使用debug关键字。
debug
function debug(fn) { [Command Line API] }
例如,将此代码粘贴到 Chrome 开发者控制台中:
function hw() { alert('hello world'); } debug (hw); hw();
它将创建一个虚拟文件并从您的函数处的断点开始。