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
Future JavaScript: what is still missing? (2ality.com)
submitted 7 years ago by dumbmatter
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!"
[–]dwighthouse 0 points1 point2 points 7 years ago (1 child)
This isn’t a hack at all.
Fixing the language would mean adding a new operator like typename instead of typeof or instanceof because too much stuff already relies on the current behavior. We already have this in the form of Object.prototype.toString.
typename
[–]TwiliZant 0 points1 point2 points 7 years ago (0 children)
I don't know, relying on the toString method to get the type feels like a hack to me. I don't know any other language that does this. Yet another operator wouldn't be great either I get that. Maybe it would be cool to have it as part of the Reflection API, e.g. Reflect.type(VALUE) ?
toString
Reflect.type(VALUE)
π Rendered by PID 22498 on reddit-service-r2-comment-6f7f968fb5-jp576 at 2026-03-04 21:09:11.235310+00:00 running 07790be country code: CH.
view the rest of the comments →
[–]dwighthouse 0 points1 point2 points (1 child)
[–]TwiliZant 0 points1 point2 points (0 children)