I’m working through Wes Bos’ ES6 for Everyone, and he’s dropped yet another useful tip for me to build into my day-to-day work - console.table.

console.table supports both objects and arrays, displaying data in a table format that is much easier to read than simply logging the data:

console.table(user) Output of `console.table` with an object data structure

console.table(repos) Output of `console.table` with an array data structure

To restrict which columns are shown for a collection of objects, a second argument can be passed to restrict which property names are shown:

console.table(repos, ["name", "description"]) Output of `console.table` with an array data structure and restricted columns

console.table appears to be supported in all modern browsers, so it’s ready to go for any development workflow!