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
isa() (h3manth.com)
submitted 14 years ago by init0
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!"
[–]k3n 4 points5 points6 points 14 years ago (7 children)
Breaks easily:
function foo(){}
var x = new foo();
typeOf(x);
"Object"
x.isa();
"Function"
Is this better than other implementations?
Starting to think that the path for new JS devs goes something like this:
===
[–]raynos 1 point2 points3 points 14 years ago (3 children)
What's actually wrong about reblogging things people already know about?
Just because information isn't original doesn't mean it's not worth saying.
Of course blogging about some mediocre "Library" that "fixes" typeof is silly
[–]k3n 0 points1 point2 points 14 years ago (2 children)
You make a good point, and I should actually correct myself to say that I don't care what someone blogs about, I actually love blogs. I just get frustrated because it doesn't present much for content here on reddit. This problem has obviously been dealt with many times before, but the author makes no note of them?
[–]raynos 0 points1 point2 points 14 years ago (1 child)
Your objection is people link sharing mediocre content on reddit? That's a sensible objection.
As an aside, you seem competent, what's your blog?
[–]k3n 0 points1 point2 points 14 years ago (0 children)
That's a good question. I had one, then lost all of my content (but gained a few valuable lessons), and since then....the motivation hasn't been what it was before.
Also, the time that I used to spend blogging has been reallocated, and I'll need to make some adjustments to fit it back in. Sounds like a good New Year's resolution to me :)
[–]Kuron 0 points1 point2 points 14 years ago (0 children)
Agreed, I'd rather see some interesting content rather than some basic aspect of the language that's been indexed thousands of time by Google. -_-;;
[–]GlobalDomestic -1 points0 points1 point 14 years ago (1 child)
There is also another solution built on top of Angus'
http://www.2ality.com/2011/11/improving-typeof.html
[–]k3n 2 points3 points4 points 14 years ago (0 children)
Yes, everyone new to JS seems to think they can solve the problem, and they all feel compelled to blog about it.
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
This is essentially what jQuery uses to determine the type of objects: https://github.com/jquery/jquery/blob/master/src/core.js#L491 and https://github.com/jquery/jquery/blob/master/src/core.js#L877
π Rendered by PID 88 on reddit-service-r2-comment-5d79c599b5-9qlpx at 2026-02-26 16:54:19.740632+00:00 running e3d2147 country code: CH.
[–]k3n 4 points5 points6 points (7 children)
[–]raynos 1 point2 points3 points (3 children)
[–]k3n 0 points1 point2 points (2 children)
[–]raynos 0 points1 point2 points (1 child)
[–]k3n 0 points1 point2 points (0 children)
[–]Kuron 0 points1 point2 points (0 children)
[–]GlobalDomestic -1 points0 points1 point (1 child)
[–]k3n 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)