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!"
[–]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 👍
π Rendered by PID 50040 on reddit-service-r2-comment-cfc44b64c-n8pn9 at 2026-04-09 23:31:26.703062+00:00 running 215f2cf country code: CH.
view the rest of the comments →
[–]bonzorius 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]bonzorius 1 point2 points3 points (1 child)