Skip to content

Advanced JavaScript logging

Grouping

To group similar log statements, you can use console.group([groupName]) and console.groupEnd():

Resulting in this output:

► URL Details

The same, but expanded:

▼ URL Details
    Scheme: HTTPS
    Host: example.com

Tables

Usually, a listing of array objects looks like this:

And the same using console.table():

(source) (source)

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.