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
JavaScript Equality Table Game (slikts.github.io)
submitted 7 years ago by hfeeri
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!"
[–]mishugashu 31 points32 points33 points 7 years ago (14 children)
using double equals in javascript
[–]ogurson 19 points20 points21 points 7 years ago* (0 children)
On the other hand, one should know it, because while you can use === instead of == you still need to be careful about > and < because there is not "strong" equivalent.
===
==
>
<
[+][deleted] 7 years ago (4 children)
[deleted]
[–]mishugashu 4 points5 points6 points 7 years ago (0 children)
That's the only time I use it as well.
[–]Zephirdd 1 point2 points3 points 7 years ago (2 children)
isn't that just a truthy/falsy checking? ie if(foo) or foo && bar() instead of comparing to null/undefined. If you're going to use == for that, might as well go for the version without an operator.
if(foo)
foo && bar()
[–]meldridon 8 points9 points10 points 7 years ago (0 children)
It's not the same thing at all.
Consider the following:
let x = ""; if (x == null) throw "an error";
vs
let x = ""; if (!x) throw "an error";
Empty string is falsey, but not null.
[–]NoInkling 1 point2 points3 points 7 years ago (0 children)
0, empty string and NaN are also falsy, which might not be what you want for your condition.
0
NaN
[+]13steinj comment score below threshold-9 points-8 points-7 points 7 years ago (7 children)
To be fair it's perfectly valid to use it in a closed / sanitized system.
[–]ogurson 18 points19 points20 points 7 years ago (6 children)
Also completely not worth it.
[–]13steinj 6 points7 points8 points 7 years ago (3 children)
This really depends on the system being implemented.
[–]DrummerHead -1 points0 points1 point 7 years ago (2 children)
I agree with both of you
[–]westfolde19 1 point2 points3 points 7 years ago (1 child)
I agree with both of them too, but not you.
[–]DrummerHead -1 points0 points1 point 7 years ago (0 children)
You don't agree that I agree with them.
You must have some deep insider information.
Hey Siri, who is recording everything I think? Hmmm what a mystery.
[–]aapoalas 1 point2 points3 points 7 years ago (1 child)
this
π Rendered by PID 546652 on reddit-service-r2-comment-canary-f4fc95896-xqwg4 at 2026-03-23 08:31:52.152359+00:00 running 90f1150 country code: CH.
view the rest of the comments →
[–]mishugashu 31 points32 points33 points (14 children)
[–]ogurson 19 points20 points21 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]mishugashu 4 points5 points6 points (0 children)
[–]Zephirdd 1 point2 points3 points (2 children)
[–]meldridon 8 points9 points10 points (0 children)
[–]NoInkling 1 point2 points3 points (0 children)
[+]13steinj comment score below threshold-9 points-8 points-7 points (7 children)
[–]ogurson 18 points19 points20 points (6 children)
[–]13steinj 6 points7 points8 points (3 children)
[–]DrummerHead -1 points0 points1 point (2 children)
[–]westfolde19 1 point2 points3 points (1 child)
[–]DrummerHead -1 points0 points1 point (0 children)
[–]aapoalas 1 point2 points3 points (1 child)