I don't see the harm in adding the second condition "element
instanceof String"
you could use :

if(element && element.constructor == String)

This works for both "foo" and new String("foo");

I find that it is faster than using typeOf.
I have made very JavaScript heavy applications and noticed that using
"typeOf value == 'Object'" and others is slow
compared to myObject.constructor, especially when called a few
thousand times.

Also I don't buy the "it hasn't been fixed since the beginning, so why
fix it now?" argument.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to