Hacker News new | ask | show | jobs
by umvi 1587 days ago
TIL there's a "debugger" keyword[0] in JavaScript that auto-sets a breakpoint at that line.

[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

2 comments

int 3 of Javascript. I use it all the time because webpacked assets make it hard to find the line of code I am looking for.
If you build source maps this isn’t a problem.
And if you're using nodejs woth source maps, but still getting horrid stacks: "--enable-source-maps"

> NODE_OPTIONS="$NODE_OPTIONS --enable-source-maps"

that is so funny, I learned that today too on a completely different page!!!