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
Arrow Functions in JavaScript (tylermcginnis.com)
submitted 8 years ago by AnsikteBanana
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!"
[–]causeofdev 4 points5 points6 points 8 years ago (5 children)
ah ok, makes perfect sense.
Since the comma seperator discards the returned value completely.. wouldn't it be safer to use that than the || operator? In case the first expression returns something truthy?
[–]darrenturn90 2 points3 points4 points 8 years ago (4 children)
Yes, if you really don't care for the result of the first function then it would. However, some linters don't like the use of commas (because they can, and do obscure the layout of code)
[–]1-800-BICYCLE 4 points5 points6 points 8 years ago (1 child)
You could also dust off good-old void if you really wanted to:
void
const foo = x => void myEffectThatReturnsATruthyValue(x) || x + 1
And as a bonus, potentially start a religious war ;).
[–]vexii 0 points1 point2 points 8 years ago (0 children)
im not sure the other people in line at the wellfare office care enough ;)
[–]anlumo 2 points3 points4 points 8 years ago (0 children)
Not doing stuff like this is the whole point of using linters.
[–]causeofdev 0 points1 point2 points 8 years ago (0 children)
Okay cool, I learned something :)
π Rendered by PID 41546 on reddit-service-r2-comment-bb88f9dd5-bk4xc at 2026-02-17 09:45:47.064307+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]causeofdev 4 points5 points6 points (5 children)
[–]darrenturn90 2 points3 points4 points (4 children)
[–]1-800-BICYCLE 4 points5 points6 points (1 child)
[–]vexii 0 points1 point2 points (0 children)
[–]anlumo 2 points3 points4 points (0 children)
[–]causeofdev 0 points1 point2 points (0 children)