Just a little trick for debugging
Johannes Millan

Johannes Millan @johannesjo

About: I love programming!

Location:
Berlin
Joined:
Apr 11, 2019

Just a little trick for debugging

Publish Date: Nov 15 '20
22 0
// 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.

Comments 0 total

    Add comment