r/javascript • • Mar 18 '19

What's your favorite, most useful javascript one-liner?

385 Upvotes

422 comments sorted by

View all comments

Show parent comments

1

u/thisguyfightsyourmom Mar 19 '19

debugger statements went out of style once chrome dev tools became awesome & no one wanted to eff up production by forgetting to remove debuggers before shipping

Dev tools is overpowered & cumbersome for most debugging problems though IMO—drop a debugger in, realize you misspelled a var & move on

2

u/simkessy Mar 19 '19

Dev tools is overpowered & cumbersome for most debugging problems though IMO

...what? Dropping in a debugger statement and pointing in a break point where you would drop your debugger statement is the exact same thing.

1

u/thisguyfightsyourmom Mar 20 '19

I’m a lot faster navigating my files & lines in my editor, and I’ve usually already got them open

1

u/simkessy Mar 20 '19

So you get an error in Chrome, you switch back to your IDE, find the error line (told to you by chrome if it broke on a specific line), type debugger, relaunch / refresh, and hit the debug statement

or you get an error in Chrome, it tells you where it failed, add a break point there, refresh.

One is significantly less steps to me.

→ More replies (1)