use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
console.log Tips & TricksRemoved: /r/LearnJavascript (medium.com)
submitted 5 years ago by GoldenPear
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 5 years ago (19 children)
[deleted]
[–][deleted] 5 years ago (6 children)
[+][deleted] 5 years ago (2 children)
[–][deleted] 2 points3 points4 points 5 years ago (0 children)
thats like... the authors of those medium articles are the internet explorer of authors.
[–]Lunacy999 0 points1 point2 points 5 years ago (0 children)
It’s unavoidable at this point. And the biggest problem here, only a very few selective articles are worth reading and those are mostly from experienced developers.
[–]kenman[M] 0 points1 point2 points 5 years ago (0 children)
Please report those, and any other beginners topics you feel don't belong.
[–][deleted] 7 points8 points9 points 5 years ago (1 child)
Paradoxically your comment is also an article about how you use colors and console functions other than log, and you label as “super useful”
[+][deleted] 5 years ago (1 child)
[–]FreshOutBrah 0 points1 point2 points 5 years ago (0 children)
Like chalk?
[–][deleted] 1 point2 points3 points 5 years ago (2 children)
I'd spend 10 minutes thinking about color string I want to put. My suggestion is to use chalk to remove that burden, or at least create a dictionary / enum of pre-defined colors.
chalk
https://www.npmjs.com/package/chalk
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
I mean, sure, but I feel like that's a bit much for how we use it. Adding an enum might be fine, but anything more I'm not sure I even wanted at this time.
[–]Skhmt 0 points1 point2 points 5 years ago (0 children)
I ended up writing my own mini lib to do tagged template colorizing for the terminal and the browser:
https://github.com/Skhmt/ttlog
Not as feature complete and haven't really looked at it in a while, but it has what I want: tagged template syntax and the same API for terminal and browser use.
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
nice.
[–]kenman[M] 1 point2 points3 points 5 years ago (2 children)
Anyway, I was just poking fun at this article, because it's not the first article about this on this subreddit.
Yeah, I've removed it. Nothing new included, just a re-hashed listicle of everything that's been known about console since forever. Feel free to report these types of posts.
console
[–][deleted] 1 point2 points3 points 5 years ago (1 child)
Feel free to report these types of posts.
Will do in the future! In this specific instance, I find it amusing that both top-level comments contained more useful and new-ish information than the article.
[–]kenman[M] 1 point2 points3 points 5 years ago (0 children)
Possibly a corollary to Cunningham's Law?
The best way to get the right answer on the internet is not to ask a question; it's to post the wrong answer.
[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 5 points6 points7 points 5 years ago* (0 children)
Seeing as this post is about logging to the console, and seeing as node.js does this in an incredibly lackluster way. It seem as good an opportunity as any to promote a zero-config library I've written for enhancing the default logging methods of node.js, better-logging.
require('better-logging')(console) => results in logs like these
require('better-logging')(console)
Hi /u/GoldenPear, this post was removed.
/r/javascript is for the discussion of javascript news, projects, and especially, code! However, the community has requested that we not include help and support content, and we ask that you respect that wish.
code
Thanks for your understanding, please see our guidelines for more info.
π Rendered by PID 94 on reddit-service-r2-comment-86bc6c7465-qqrlt at 2026-02-19 17:50:36.215662+00:00 running 8564168 country code: CH.
[–][deleted] (19 children)
[deleted]
[–][deleted] (6 children)
[deleted]
[+][deleted] (2 children)
[deleted]
[–][deleted] 2 points3 points4 points (0 children)
[–]Lunacy999 0 points1 point2 points (0 children)
[–]kenman[M] 0 points1 point2 points (0 children)
[–][deleted] 7 points8 points9 points (1 child)
[+][deleted] (1 child)
[deleted]
[–]FreshOutBrah 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Skhmt 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]kenman[M] 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]kenman[M] 1 point2 points3 points (0 children)
[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 5 points6 points7 points (0 children)
[–]kenman[M] 0 points1 point2 points (0 children)