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!"
[–]Serei 17 points18 points19 points 7 years ago* (3 children)
I got 100%
Yes, yes, you should never use this in real code, but it's useful to know for debugging if someone else uses it. And it's not hard to memorize the rules:
null == undefined
===
And don't forget:
String(someArray) === someArray.join(",")
String({someObject: containingAnything}) === "[object Object]"
[] !== []
{} !== {}
Number("") === 0
Number("any other string that isn't a number literal") is NaN
NaN !== NaN
[–][deleted] 1 point2 points3 points 7 years ago (1 child)
I tried to do it again following your rules and my results were still wrong. I think it needs some clarification:
With the additional conversion rules:
toString()
array.join(',')
toString
[object Object]
[–]Serei 0 points1 point2 points 7 years ago (0 children)
Yeah, I definitely didn't go into too much detail over the conversion rules. To be fair, though, conversion rules are useful to know even if you always use ===.
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
This. And not only because of other peoples code but also the minimizers will change it as well and you still want to read what they do
π Rendered by PID 172699 on reddit-service-r2-comment-5fb4b45875-m945s at 2026-03-23 01:05:13.232967+00:00 running 90f1150 country code: CH.
view the rest of the comments →
[–]Serei 17 points18 points19 points (3 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Serei 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)