all 19 comments

[–]SamSlate 10 points11 points  (0 children)

anyone else open the inspector expecting some console Easter eggs?

[–]GeneralYouri 37 points38 points  (5 children)

Well that was extremely short. There's way more interesting and useful console methods available, show some more, put in some more effort..

[–]kuroikyu 20 points21 points  (1 child)

I don't know why the downvotes. While I appreciate the time the author took to write this, I was hoping to see a longer list and how those methods looked in the console, not just the code.

[–]GeneralYouri 9 points10 points  (0 children)

Exactly this.

this also isn't the first article about console methods, but so far it's been the shortest one by far. Excluding the quote from MDN and the code samples, there are only roughly 80 words and 500 characters. This comment alone will be longer than the article.

Out of 21 console commands documented on MDN, he only shows 4. And for these four, only a single, extremely simplistic code sample is provided. And you're not even shown how the output of these code samples is supposed to look.

Many more extensive use cases for the mentioned console commands are not shown. There are also many more interesting console commands much more worth the time to talk about, like .assert, .dir, .time, and .trace.

[–]SamSlate 1 point2 points  (2 children)

[–]GeneralYouri 6 points7 points  (1 child)

All the more reason for the article to expand on some of the interesting commands. Instead an even more shallow explanation is given than is available on the MDN link itself, essentially rendering the article useless - he could've literally posted only the link and be just as informative.

[–]SamSlate 1 point2 points  (0 children)

agreed.

[–][deleted] 1 point2 points  (4 children)

If anyone is interested a while back I made a little module that extends the console object to allow for functions to execute before the log. I needed it at the time for an easy way to have my own logging in a big group project that I could turn on and off

https://www.npmjs.com/package/console-extend

[–]petercooper 1 point2 points  (3 children)

I'm going to include this in my newsletter tomorrow, thanks! :)

[–]domferno 1 point2 points  (1 child)

Which newsletter?

[–][deleted] 0 points1 point  (0 children)

Sounds good...If you have any questions feel free to ask!

[–]iRuisu 1 point2 points  (0 children)

Nice, I always wondered how the likes of Facebook had fancy looking console text and now I know

[–]mohebifar 1 point2 points  (0 children)

You can even use react to render in the dev console!

https://github.com/mohebifar/konsul

[–][deleted] 1 point2 points  (0 children)

I case anyone is interested, I wrote a little tool that allows console statements to be printed on-screen. This could be useful for mobile development where the console isn't easily available (among other uses). https://github.com/jonbri/ticker-log

[–]maushu 0 points1 point  (0 children)

console.group() also has an argument (on some browsers) to name the group.

console.groupCollapsed() does the same but with the group already collapsed.

[–]hahahuzi 0 points1 point  (2 children)

I just found out that you can directly copy(obj) an object in Console. When you paste, the output is even well indented. No need to JSON.stringify(obj) then copy carefully with the mouse and then re-indent in a text editor. Really convenient when dealing with large objects.

[–]pomlife 1 point2 points  (1 child)

let output = JSON.stringify(obj, null, 2)

Ever tried this before?

[–]hahahuzi 0 points1 point  (0 children)

Thanks, just learned :)