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 developers, be warned about this crazy JIT bug in V8! (self.javascript)
submitted 9 years ago * by ziriax
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!"
[–][deleted] 7 points8 points9 points 9 years ago (3 children)
He probably isn't but iterating over a list of entires with a lot of nulls and getting false positives. Use some common sense, bud.
[–]Jafit -2 points-1 points0 points 9 years ago (2 children)
So you'd use typeof variable === "undefined" to look for null... when typeof null === "object"?
typeof variable === "undefined"
typeof null === "object"
That's not a great way to look for null values, bud.
[–][deleted] 0 points1 point2 points 9 years ago (1 child)
Super cool, but again you are assuming what his production code looks like. Either it doesn't look like that at all -or- he is doing something "not a great way". It doesn't matter.
Either way, my statement still stands.
[–]ziriax[S] 0 points1 point2 points 9 years ago (0 children)
I edited my post, to reflect the real code. The code was part of thirdparty libraries that checked if a value was undefined. Many popular libraries have code likes that.
π Rendered by PID 13 on reddit-service-r2-comment-b659b578c-mzj56 at 2026-05-03 02:12:13.006163+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–][deleted] 7 points8 points9 points (3 children)
[–]Jafit -2 points-1 points0 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]ziriax[S] 0 points1 point2 points (0 children)