Actually, I think there are two different things we could look into:
1. A series of methods returning a boolean (which could take any, or a
combination of the following forms):
Object.isArray()
Object.is.array()
is.array() (that's my favorite by far... similar to Try.these)
$is.array()
2. a $typeof that would actually return correct values.
$typeof([])
// -> 'array'
$typeof(document.body)
// -> 'HTMLElemnt'
This would be great for switch statements:
var type = $typeof(thing);
switch(type) {
case 'string':
//do something
break;
case 'array':
//do something
break;
...
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---