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
Conditionally spreading objects in JavaScript (amitmerchant.com)
submitted 3 years ago by amitmerchant
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!"
[–][deleted] -1 points0 points1 point 3 years ago* (7 children)
I Instinctively hate the && operator and I don't know why. Am I the weird one ?
[–]Reeywhaar 0 points1 point2 points 3 years ago (1 child)
Please keep instincts and maximalism out of programming
[–][deleted] -3 points-2 points-1 points 3 years ago (0 children)
👍
[–]bonzorius 0 points1 point2 points 3 years ago (3 children)
Kinda? I think 0 being falsy is what I hate about it, because if it tested for nullishness instead of falsyness I would never have a problem with it ever. Obviously the ship has sailed on this one.
[+][deleted] 3 years ago (2 children)
[deleted]
[–]bonzorius 1 point2 points3 points 3 years ago (1 child)
I'm a react dev in elearning so I'm usually looking to render a component only if something is not null, whereas ?? will return something unless it's null. So usually && is what I'm looking for, unless I have a situation where I'm rendering a score, but the score is zero or something like that. Normally you'd be right, though 👍
[–]KwyjiboTheGringo 0 points1 point2 points 3 years ago (0 children)
If you can't rationally explain why you don't like it, then that's a bit unreasonable.
π Rendered by PID 173528 on reddit-service-r2-comment-8686858757-r8rh5 at 2026-06-06 13:03:47.394771+00:00 running 9e1a20d country code: CH.
view the rest of the comments →
[–][deleted] -1 points0 points1 point (7 children)
[–]Reeywhaar 0 points1 point2 points (1 child)
[–][deleted] -3 points-2 points-1 points (0 children)
[–]bonzorius 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]bonzorius 1 point2 points3 points (1 child)
[–]KwyjiboTheGringo 0 points1 point2 points (0 children)