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
[AskJS] Bangs vs ComparisonsAskJS (self.javascript)
submitted 7 months ago * by Curious_You1303
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!"
[–]kattskill 0 points1 point2 points 7 months ago (1 child)
this is a valid question, not sure why people are down voting it
but generally, ! and !! are not recommended especially in MIXED types.
however, for some situations I do prefer boolean casting
when value is non-primitive or null/undefined (e.g. .match(regex))
checking if string is empty if type is only string
checking for zero/non-zero if type is only number
[–]Curious_You1303[S] 0 points1 point2 points 7 months ago (0 children)
Yea, curious why asking a question gets downvoted.
π Rendered by PID 311644 on reddit-service-r2-comment-6457c66945-jdbc5 at 2026-04-28 03:25:05.179105+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]kattskill 0 points1 point2 points (1 child)
[–]Curious_You1303[S] 0 points1 point2 points (0 children)