I'm hoping to be able to pretty print array objects and such in the Console of Chrome DevTools. Is there any means to achieve this?
Thank you!
If it's the Sources panel, you can manually enable or disable pretty-printing by clicking Format. In general, if you see that icon anywhere, clicking it will enable or disable pretty-printing. Show activity on this post. I just did the same thing because of the really poor UI there.
If you whant to pretty print a block of js code minimized in a long line add somewhere at the beginnig of code a debugger statement, than paste to the console and run thwe code. The Debugger statement will be reached and the code will be opened into "sources" panel. Here you can use the pretty print button.
log('%c ', style); }; image. src = url; }; and then just use console. image(URL[, size]); to print out the image.
You could format the data as JSON:
console.log(JSON.stringify({foo:1, bar:2}, null, 4)); { "foo": 1, "bar": 2 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With