Update: After some requests from some of you I also added some ways for you to style your console outputs. Check out Facebook's console to see styl...
For further actions, you may consider blocking this person and/or reporting abuse
Hi, this article is going to be very useful, thank you.
I do have a question though. I encountered this problem not a long time ago but I couldn't find an answer to it.
When I run this on the Chrome console:
it takes around 35 seconds to display on Chrome console the result which is around 5000 ms.
Does this mean that while the (V8?) takes 5 seconds to run the code, Chrome console is much slower to show the result of all iterations?
Printing to the console is slow. Yes. Have you tried the same thing without a .log in the loop? Probably much much faster
Yep, just tried as you suggested and it turned out that an addition without console.log() is roughly 2500 times faster. I got it, thank you.
This isnβt specific to chrome
Excellent, I love .table() and now I have some new console tools to use! Great job and great clarity in your style.
.table() has become one of my new favorites, it makes viewing datasets much easier
Using
console.info('my message')
you can deliver my message πNice info
I love using css colors and sizing in my logging when I have a lot of noise. console.log(β%cMy Messageβ, color: βredβ) will print a red colored My Message.
Thanks for the tips
This is something I actually didn't know was possible, thanks for that tip. I'll actually update the post to include this as well
Looks like I forgot my quotation marks around the color:red part. Check out facebookβs console sometime. Itβs decked out (or at least it used to be, I donβt have fb anymore)
Can you expend your post with color syntaxes ?
Thank you so much, .table save my mind now ! π
Yes, working on an update to include color syntax as well
TIL about console trace and assert! Thank you!
Thanks for .table()π
This is great information. I honestly had no idea. Thank you so much for sharing this.
I come here to see all the methods I already know, not expecting anything new, but I actually saw some that I didn't knew, so thank you.
I'm glad you were able to find some new methods on here
Thanks for that overview, console object is definitely underused. I also write 'console.count()' to get the times a function is called.
Fantastic - bookmarked!
It is also possible to use console.log with JSON.stringify(someObject, null, 2)
My mind has been blown.
Great article indeed.
I actually learned stuff.
I did not know FB had styled the console like that!
Very useful console functions.
Thanks!
the code is not the reason why it froze, it runs smoothly.
Recently I accidentally came to know about these from MDN reference and thinking of making a post on this...
Anyway Nice post π€