DEV Community

Johannes Millan
Johannes Millan

Posted on

Just a little trick for debugging

// instead of
console.log('someVar', someVar);

// I now often just do this:
console.log({someVar});
console.log({someVar, someOtherVar});
Enter fullscreen mode Exit fullscreen mode

Might not be a new idea to some of you while others will frown upon using console.log at all. I still like to share this neat little "trick" to label my variables when logging.

Top comments (0)