DEV Community

Discussion on: Javascript: 5 cool things you can do with console that aren't console.log

Collapse
 
perpetual_education profile image
perpetual . education

We basically write console.clear(); at the top of every CodePen. We get a lot of use out of that one! When 'objects' and 'methods' finally clicked back when, realizing there were so many console.log messages was like finding a magic lamp!!! : ) .info() used to have a nice blue style - but might have gone away....

Collapse
 
catmcgeecode profile image
Cat McGee

console.clear() is a great one, should've included that guy! I've never actually used console.info() and heard it was literally the same as console.log(), but if it's nice and blue I've gotta check it out. Thanks!

Collapse
 
perpetual_education profile image
perpetual . education

There's the color options too!

console.log('%c thing one! ', 'color: red');
console.log('%c thing green! ' + '%c thing blue! ', 'color: green', 'color: blue');

We use these for little hidden messages for sneaky developers... ; )