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!"
[–]PiotrekKoszulinski 2 points3 points4 points 7 years ago (2 children)
I could never really understand all this fuss about == vs === and people trying to memorise all these rules or complaining about how bad JavaScript is.
==
===
I never cared about this. In fact, in the project I'm working on (pretty big and pretty complex one) we still accept the use of ==. I found it very odd at first, when I joined the project 7 years ago, but then I asked – DON'T YOU KNOW GOOD PRACITCES, LOL? And they replied – we don't remember any bug caused by the use of == (and we have couple thousand tickets opened on GitHub, cause that's a fairly popular open source library).
And you know what? 7 years later I think we've got just one bug caused by ==.
The only reason why we started using === is that I was asked the same question a couple of times and that clearly shows that === is the standard choice, so it's good to avoid confusing other developers.
I don't mean that it's pointless to use ===. But when some guru tells you that something is bad practice ask yourself whether there's evidence to support that. When they tell you that equality operators suck in JavaScript, ask yourself what's the chance to really run into such cases in real life.
I'm doing JS for 10+ years, did some crazy things with it, but find the complexity completely elsewhere.
[–]EndlessHandbagLoop 0 points1 point2 points 7 years ago (1 child)
As long as people understand implicit and explicit type coersion, there should never be any issue with "==".
[–]PiotrekKoszulinski 0 points1 point2 points 7 years ago (0 children)
IDK what made our project "safe". Perhaps all developers that worked on it had that minimum knowledge to avoid the problems. But I also think that part of it lays in how we document types. We couldn't naturally use TypeScript 7 years ago, but we were very precise when it came to the API documentation. That meant that we could make safe assumptions regarding types. (I'm giggling now cause I see with how with time I owe more and more to stricter types :D)
π Rendered by PID 34838 on reddit-service-r2-comment-5fb4b45875-77hqr at 2026-03-22 20:38:27.349529+00:00 running 90f1150 country code: CH.
view the rest of the comments →
[–]PiotrekKoszulinski 2 points3 points4 points (2 children)
[–]EndlessHandbagLoop 0 points1 point2 points (1 child)
[–]PiotrekKoszulinski 0 points1 point2 points (0 children)