Advanced console.log Tips and Tricks (2020)
1–10 of 73 posts
Re: Advanced console.log Tips and Tricks (2020)
#2https://developers.google.com/web/updates/2015/05/quickly-mo...
Very useful when you are wiring events together on the front end.
Surprised there isn’t a standard way to do this in the DOM.
Re: Advanced console.log Tips and Tricks (2020)
#3It annoying.
Re: Advanced console.log Tips and Tricks (2020)
#4Re: Advanced console.log Tips and Tricks (2020)
#5Re: Advanced console.log Tips and Tricks (2020)
#6console.log({x,y,z})
not
console.log(x,y,z)
Who needs pretty-printing, formatting libraries, string interpolation etc?
Re: Advanced console.log Tips and Tricks (2020)
#7What pains me that browsers no longer put blue icon with console.info. Like, what's the point of having it if it's going be virtually indistinguishable from .log? It annoying.
Re: Advanced console.log Tips and Tricks (2020)
#8const obj = {objection: 'overruled'}; console.log( 'console.log is the #%d %s API ever written %f\% no arguing! %o %O !!!', 1, 'greatest', 100, obj, obj);
I've tried to keep my example compliant but it's still a very tiny loosy-goosy standard, for example at least in Firefox you can write %.0f to skip printing the fractional part of the float, but the standard doesn't mention this.
Re: Advanced console.log Tips and Tricks (2020)
#9Not directly console.log related, but you can use the console-only monitorEvents() method to log all the events triggered on an element: https://developers.google.com/web/updates/2015/05/quickly-mo... Very useful when you are wiring events together on the front end. Surprised there isn’t a standard way to do this in the DOM.