Chrome DevTools – console.table() function

It’s the simple things in life that can really make you happy… like the chrome developer tools console.table() function. It was released in 2013 but I only learned about its awesomeness today!

Logging to the console the old way

way, way back in the day (i.e. yesterday) I was logging objects straight to the console

var nirvana = [
{ name: "Kurt Cobain", instrument: "guitar" },
{ name: "Krist Novoselic", instrument: "bass" },
 { name: "Dave Grohl", instrument: "drums" }
];

console.log(nirvana);

and expanding out tree views to see what was going on…

old skool

Logging to the console with console.tree()

Enter console.table()

var nirvana = [
{ name: "Kurt Cobain", instrument: "guitar" },
{ name: "Krist Novoselic", instrument: "bass" },
 { name: "Dave Grohl", instrument: "drums" }
];

console.table(nirvana);

A nice formatted table with sortable  columns.

new skool1

 

Thank you Chrome DevTools for caring !

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s