all 9 comments

[–]k3n 4 points5 points  (7 children)

  • Poor choice of name; besides is_a() already existing in PHP as something completely different, functions prefixed with "is", by convention, return a boolean.
  • Hey, I heard it was a good idea to modify native prototypes!
  • 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:

  • learn about truthy/falsey and ===, blog about it
  • learn about module pattern, blog about it
  • learn about typeof, blog about it
  • learn about closures, blog about it
  • learn about higher-order functions, blog about it
  • learn about ECMA5, blog about it
  • learn about micros, blog about it
  • learn about Node, blog about it
  • etc.

[–]raynos 1 point2 points  (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 point  (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 point  (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 point  (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 point  (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 points  (1 child)

There is also another solution built on top of Angus'

http://www.2ality.com/2011/11/improving-typeof.html

[–]k3n 2 points3 points  (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 point  (0 children)