This never crossed my mind. Wow! So cool. Thanks for sharing this. I'll definitely start using it.
I use this one.
const debugApp = false;
const debugMsg = (msg) => debugApp && console.log(msg)
Great tip given in general. This is called working smart. Although for all the devs out there I would suggest you to use debugger because the habit of writing console.log() will become very confusing to find any error especially when your project scales up.
I was getting annoyed by having to type the full thing so many times, especially when debugging JS code, and my solution was to add a user code snippet to VSCode that stores it. So now I just press cl, and it already suggests the full method. The beauty of it is that you can create snippets for literally anything you want!
One thing I like to do is write a "logger" module. Just a set of thin wrappers over console.log(). But I can for example, use it as a request logger middleware in Express, an error logger, and so on :)
Thanks for the advice. I will refactor my project Selenidium Element Inspector๐: github.com/mszeles/selenideium-element-inspector
Taranpreet Singh
Hi, I am 15 years old and love writing in the next js. How can I reach you? If you are interested in the world's 1st self community website, you can message me on discord -- discord.gg/4tWJPc7c3E