DEV Community

Cover image for The Console API.

The Console API.

Sebastian Anioke on August 12, 2022

The ability to spend less time finding errors in a code is a necessary skill that every developer should have. The Console API, a debugging tool t...
Collapse
 
elsyng profile image
Ellis • Edited

Great article. You may want to add console.dir().
I find it very useful as a version of console.log() where the object or array is automatically expanded, instead of me having to click it open every single time.

Collapse
 
chucks1093 profile image
Sebastian Anioke

Thanks for the suggestion

Collapse
 
ndrean profile image
NDREAN • Edited

Also n=3;m=4; console.log({n,m}); returns {n: 3, m: 4}

Collapse
 
fyodorio profile image
Fyodor

Great hack with destructuring to pass linters and CI/CD 😂

Collapse
 
qm3ster profile image
Mihail Malo

lmao

Collapse
 
enyichiaagu profile image
Amazing Enyichi Agu

Thanks. This is beautiful 🎉

Collapse
 
sidmirza4 profile image
Mohd Shahid

Great article, very few people write about Console API

Collapse
 
chucks1093 profile image
Sebastian Anioke

Thank you.

Collapse
 
andrewbaisden profile image
Andrew Baisden

A great run through this was so informative.

Collapse
 
kolja profile image
Kolja

The last is the best!

Collapse
 
zhouyg profile image
zhou-yg

Console.table is useful but this method only support the obj which nested depth under 2

Collapse
 
chucks1093 profile image
Sebastian Anioke

Do u mean it doesn't work when u used it with a simple obj?

Collapse
 
iamjaydev profile image
iamjaydev

Great work!!!

Collapse
 
delta456 profile image
Swastik Baranwal

This is really useful. Thanks for sharing!