DEV Community

Akhlak Hossain Jim
Akhlak Hossain Jim

Posted on

Console.table() | Jim

What is console.table()?

I know you are mostly using console.log() for displaying some data for a lot of reasons. One of the reasons might be to just show a fetched array of data.

Please stop doing that, there is a best method for showing an array of data, which actually shows the JSON/array data as a data table. Which makes debugging or seeing data in a more readable way. You can see the field name at the top just like the table.

It is as you can guess is console.table().

It shows all the fields even if some object might not have that particular field value(the box remains empty). So you don't have to look through all the data if you know, how hard it is to see a big array of objects.

So, at least try that out to make your life easier.

To know more check the MDN documentation: here.

Top comments (0)