Home > Tips & Tricks > JavaScript console.log() vs console.table()

JavaScript console.log() vs console.table()

Hello friends, you may all know about only the console.log() method to print the result on screen in javascript, but today I will tell you about the javascript console.table() method.

The console.table() method is also a great javascript debugging tool same as the console.log() method. You may haven’t used it before, so let’s compare console.log() vs console.table() methods of javascript.

console.log() vs console.table()

The difference is that the console.log() method prints the result in the web console or on the screen. It will print all values in the tree with the data types

And the console.table() method prints the only values in the visual table with their index number. It shows the values in a well-structured table format.

Example: console.log()

Output

Javascript console.log() example

Example: console.table()

Output

Javascript console.table example

Being Tricky 😉

Photo of author

About Aman Mehra

Hey there! I'm Aman Mehra, a full-stack developer with over six years of hands-on experience in the industry. I've dedicated myself to mastering the ins and outs of PHP, WordPress, ReactJS, NodeJS, and AWS, so you can trust me to handle your web development needs with expertise and finesse. In 2021, I decided to share my knowledge and insights with the world by starting this blog. It's been an incredible journey so far, and I've had the opportunity to learn and grow alongside my readers. Whether you're a seasoned developer or just dipping your toes into the world of web development, I'm here to provide valuable content and solutions to help you succeed. So, stick around, explore the blog, and feel free to reach out if you have any questions or suggestions. Together, let's navigate the exciting world of web development!

Leave a Comment