Ah, debugging… Something we all have to do! You’re undoubtedly familiar with the
console.log() method. But did you know you can get much prettier output using the
Given the following object literal:
I can call
console.table(person) to get the following output:
It also works with array literals:
console.table(fruits) gives me the following output:
console.table() method prints things to the console in a pretty, readable format. It’s a nice alternative to the
For more information, check out
console.table() in the MDN Web Docs.
If you have questions, feedback, or any other suggestions, please do email me. I'd love to hear from you!