Categories
JavaScript Answers

How to print JSON data in JavaScript console.log?

Spread the love

To print JSON data in JavaScript console.log, we use the '%j' option.

For instance, we write

console.log("%j", jsonObj);

to call console.log with "%j" and the jsonObj object to print JSON objects with console.log.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

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