Creating tables with console.table in Chrome - good coders code, great reuse |
Creating tables with console.table in Chrome Posted: 22 Sep 2014 01:36 PM PDT Check out this awesome trick that I just discovered. You can use Here's a simple example. Let's simply enumerate the alphabet, convert it to upper case, and also convert it to hex. Copy this to developer console: var data = []; var alphabet = "abcdefghijklmnopqrsuvwxyz".split(''); alphabet.forEach(function (char) { data.push({ lowerCase : char, upperCase : char.toUpperCase(), hex : "0x" + char.charCodeAt(0).toString(16) }); }); console.table(data); Here's the result:
Apparently `console.table` has been in Chrome since February 2013 but I only discovered it now. Next time I'll need a table, I'll just dump data in Chrome's developer console. |
You are subscribed to email updates from good coders code, great reuse To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment
Keep a civil tongue.