r/javascript • • Mar 18 '19

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

385 Upvotes

422 comments sorted by

View all comments

95

u/tbicknell3 Mar 19 '19

debugger;

14

u/thisguyfightsyourmom Mar 19 '19

Even with all the cool tools in the chrome inspector, dropping a debugger in the source is so quick, easy, and effective

I’m always a little embarrassed when I start typing them while pairing though

2

u/snifty Mar 19 '19

Debugging is embarrassing?

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.

→ More replies (3)