3 ms·
One thing I didn't see in the article: As well as setting breakpoints, one can trigger the debugger by including the statement debugger; in a script. The
by kornish 8y ago
One thing I didn't see in the article:
As well as setting breakpoints, one can trigger the debugger by including the statement
debugger;
in a script. Then, having the Dev Tools console open when that statement executes will automatically hop you into the debugger with access to variables in scope, etc. Easier IMO than manually setting breakpoints, especially when working with some transpiled languages.
- fermuch 8y agoFor transpiled languages: if you set up source maps correctly, you can access the non-transpiled language and the devtools will set up rules on the correct places (in this case, breakpoints, which also jump automatically to the original source instead of the transpiled version)
- 52-6F-62 8y agoThis works great with TypeScript