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

8

u/KinkyCode Mar 19 '19

That seems awfuly cumbersome when you may as well just log stuff as you build it...

0

u/catwhatcat Mar 19 '19

For compiled code (from Angular, TS, etc.) it can save time and you generally don't want logs in your code unless it's thru some kind of service that obfuscates their location.

3

u/duGarbandier Mar 19 '19

It's very cool, but I still prefer console.log I think, since they can be commented out and uncommented at any point later during development. Generally a production build will automatically strip out logging won't it?

2

u/KinkyCode Mar 19 '19

I see. That does make sense.