Quickie: the step-children of the Console

Mat Davis
Mat Davis
Aug 27, 2017 · 2 min read

I’ve always believed learning as many details as possible about as many features of a tool as possible allows maximum usage of that tool. We all know console.log but how well do we know the step-children of the Console object?

1. Console.assert( )

logs a message when a set condition equals false

2. Console.count( )

logs the # of times count( ) and the same label were called

3. Console.dir( )

logs a JS key/value pair view of an argument

4. Console.error( )

logs a message styled like an error with a stack trace and red x icon

5. Console.group( ) and Console.groupEnd( )

console.group() STARTS a group for messages logged after this method. console.groupEnd() CLOSES the group

6. Console.groupCollapsed( )

collpases the group by default

7. Console.time( ) and Console.timeEnd( )

Console.time( yourLabel ) starts the timer. Console.timeEnd( yourLabel ) shows the time passed

8. Console.trace( )

logs a trace from where the method was called. lolo( ) is on line:1 but First time is on line:3–2nd time is on line:5

9. Console.warn()

logs a message that is styled like a warning with a caution icon to the left

For more detailed info, visit the CONSOLE API MDN PAGE.

)
Mat Davis

Written by

Mat Davis

Self taught VBA Coder, Opspark Bootcamp taught Javascript Coder, Creative, innovative imaginator, born to discover my damn self thru my damn self and others.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade