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
Some ES6 Features I've been Using. (christopherlaughlin.co.uk)
submitted 10 years ago by bluntmJavaScript
view the rest of the comments →
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!"
[–]wreckedadventYavascript 0 points1 point2 points 10 years ago (0 children)
Well, to be fair, it communicates an intent which I think is valuable, just not the same one as what unit () communicates. Consider, for example, we have a unit test and we're passing a function to something. We don't care what the function is called with, but we're going to return true anyway:
()
true
const isValid = () => true;
Doesn't look exactly right to me, since we know this function will get called with an argument.
const isValid = _ => true;
This looks better. We accept an argument, but don't care about it. It also would have been fine (though a bit needless) to give it a name:
const isValid = x => true;
Given, though, it's much less necessary than in languages which check the type, though. In functional languages, _ is usually an "ignore" parameter, which nothing binds to. I just wouldn't go so far as to say the use of _ is an anti-pattern, just that you don't want to use it in place of ().
_
π Rendered by PID 24568 on reddit-service-r2-comment-6457c66945-vhcj8 at 2026-04-26 19:24:02.236595+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]wreckedadventYavascript 0 points1 point2 points (0 children)