Re: Detecting the "type" of a DOM object

On 6/6/12, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> There's a common problem where someone has an object and they would like
> to tell whether it's a Node (or an Array or a Date or whatever).  Right

It's only a problem if you do that and there's no need to do it anyway.

The general consensus for years over at c.l.js, based on many long and
sometimes heated discussions (usually involving jQuery fans) is that
the desire to know the inheritance structure of an object is rooted
primarily in the use of overloading strategies. The problems with
overloading are more noticeable for methods that are broad in what
they claim to accept, such as any of host object, native ES objects,
user defined object, primitive value. That was a very big want among
the developers of Jquery, particularly since it failed miserably in
IE.
-- 
Garrett
Twitter: @xkit
personx.tumblr.com

Received on Thursday, 7 June 2012 21:47:34 UTC