Last Updated: February 25, 2016
·
4.498K
· colemike

Displaying JSON as a Table in Dev Tools Console

If you are dealing with blobs of JSON in your app and need a way to easily visually inspect it, here's a simple method:

var team =
[{"name":"Jason Nissen","username":"jasonnissen","badges_count":0,"endorsements_count":0},                {"name":"Chris Rouw","username":"chrisrouw","badges_count":0,"endorsements_count":0},{"name":"Chad Feldmann","username":"cfeldmann","badges_count":0,"endorsements_count":0},{"name":"Tyler Kane","username":"tykane91","badges_count":0,"endorsements_count":0},{"name":"Mike Cole","username":"colemike","badges_count":4,"endorsements_count":0},{"name":"Lana Wrage","username":"farreachlana","badges_count":0,"endorsements_count":0}];

console.table(team);

produces a simple, sortable table in your dev tools console.

See it in action here: http://jsfiddle.net/colemike/5qrgz8hs/

1 Response
Add your response

Works also great with arrays ..

over 1 year ago ·