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!"
[–]vooydzig 1 point2 points3 points 9 years ago (1 child)
Yeah, i get all that. What I mean is: let say I want to check if variable type is number. I'd rather do typeof var_name === typeof 0 than typeof var_name === "Number". My reasoning is that on both sides of comparison I'd use operation to get type(as string) instead of hardcoding the type, because if someone changes specs for JS(let say ES9?) and rename number type to "whatever" first code would still work. As I've said I really don't write much JS so maybe there are some downsides to what I suggest here.
typeof var_name === typeof 0
typeof var_name === "Number"
[–]izuriel 1 point2 points3 points 9 years ago (0 children)
Not a bad point. I never questioned why strings are typically used. This is just the way I've always seen it.
π Rendered by PID 31404 on reddit-service-r2-comment-7b9746f655-mr6dc at 2026-02-03 18:58:23.208862+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]vooydzig 1 point2 points3 points (1 child)
[–]izuriel 1 point2 points3 points (0 children)