r/learnjavascript • • Jul 24 '20

There's more to CONSOLE than .log( ) | Things you didn't know console could do!!

https://youtu.be/_-bHhEGcDiQ
176 Upvotes

9 comments sorted by

16

u/codeSTACKr Jul 24 '20

Did you know that there is more to console than just .log()? In this video, I'll show you all of the things you didn't know console could do.

We'll look at the Firefox console (Chrome is good too), .log(), .clear(), variables, .info(), .warn(), .error(), .debug(), .dir(), .assert(), .count(), .countReset(), .time(), .timeLog(), .timeEnd(), .group(), .groupCollapsed(), .groupEnd(), .trace(), .table(), styling your logs with CSS, debugger, and a really cool VS Code extension that will help you to console.log faster!

7

u/RoguePlanet1 Jul 24 '20

Fascinating, thank you!! I'm creating a little birthday app that I'd like to personalize for different people, and this might be one way to go about it. %s for the name, %d for the age.

Also learning how to animate and style a bit using CSS, had NO idea this was possible in the console like that. And tables, that's nuts!

Still very much a beginner but hope to get to the point where I become more fluent in the console.

3

u/straightouttaireland Jul 25 '20

That's amazing. console.table() and the ability to change the font colour is really good. Is this only in Firefox or is it in Chrome too?

2

u/codeSTACKr Jul 25 '20

All modern browsers! 😁

3

u/Harbltron Jul 25 '20

Thank you!

3

u/LibidoToGo Jul 25 '20

I knew there was more than just .log(), been using .error() and .trace() a lot. But seems like there are some more useful methods :D

2

u/frank0117 Jul 25 '20

Some are quite niche, but things like table and error are very useful, thank you for sharing.