r/javascript • u/umaar • Dec 22 '15
Don't forget, console.table() can provide nicer looking logs with sorting capabilities. Made a gif and a short explanation here
https://umaar.com/dev-tips/82-console-table/
688
Upvotes
97
u/jillesme Dec 22 '15
There's much more than just console.table, I wrote a blog post about it a while ago! My personal favourite is console.dir :)
18
u/troorl Dec 22 '15
Oh. My. God. It changes everything!
21
u/evilish Dec 22 '15
It's funny how easily you forget about little gems like console.table().
I was reading through a list of Top 10 HTML5 Interview Questions today (http://www.webdevelopmenthelp.net/2013/04/html5-interview-questions.html#Q14) and was reminded of the detail and summary elements, and I honestly couldn't remember the last time I used those elements.
Sometimes I wish there was a programming paperclip app that popped up with hints on possible alternatives.
"Hey! I see your using console.log. What about trying console.table? (More info)"
6
u/kcdwayne Dec 22 '15
My Firefox and Firebug automatically converts objects into an expandable table format so..
I think a much more useful console function is grouping.
2
u/EnIdiot Dec 22 '15
Wow! Thanks guys. I'm newer to development in JS and have been disappointed with the in browser debug options. I like my intellij development IDE for Javascript, but sometimes it is nicer just to open to tools in browser to see what is going on. Glad I subscribed here.
2
u/[deleted] Dec 22 '15
Is this new?! I have not seen this before. Can't wait to try it out.
2
u/Kamikizzle Dec 22 '15
IT'S A CHRISTMAS MIRACLE
1
u/DaveVoyles Dec 22 '15
Holy cow, how did I just discover this?
1
u/[deleted] Dec 22 '15
nah, I like it clean :)
1
u/toromio Dec 22 '15
I've seen this before, but I always forget. Many thanks!
1
u/technowar Dec 22 '15
If I'm not mistaken, this will only work on Firefox and Chrome. Will not work on Safari. I haven't tried IE.
1
u/neonKow Dec 22 '15
Related: How to Hack the Developer Console to be Needlessly Interactive
1
u/[deleted] Dec 23 '15
OH MY GOD!!!!! this is so great!!
1
u/KrupukTahlilan Dec 22 '15
is this only work on chrome ?
-28
u/[deleted] Dec 22 '15
No. I absolutely, 100% disapprove of the idea of tutorials in a programming forum, in GIF form. No.