i've been playing around with implementing a count method in JS, that will
return the length of a given variable, no matter what it's type is.
this is mainly useful for switching between array/object/string, but also
might be interesting to see it work with elements.
obviously, the main problem is how to handle types that have no distinct
length, like functions, regexp etc.

I've come up with this http://www.jsfiddle.net/tvYQT/1 as a proof of
concept.
What do you think? would you find this useful? how would you handle
non-lengthy types?
-----------
אריה גלזר
052-5348-561
5561

Reply via email to