Categories
JavaScript Quick Tips Quick Tips

Using object shorthand when debugging

< 1 min read

When using console.log() in Node.js it can be hard to spot variables you’re logging in your terminal, especially if they’re empty.

Use object shorthand so that every value has a name next to it e.g. console.log({ someVar, anotherVar }); – works with one variable or many 👌

Leave a Reply

Your email address will not be published. Required fields are marked *