How about this approach:
- use one wrapper function called basetype() that would return either
'number', 'string', 'boolean', 'null', 'undefined' or 'object'
- use instanceof operator for checking all other types that are based
on Objects ('Function', 'Array', 'Element', 'RegExp', etc.)I think this would be the most flexible solution. The only disadvantage I have found so far is that instanceof might return incorrect values if there are multiple frames involved: http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/ -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
