In order to make the syntax for one of my functions nicer, I need to be able to tell whether a specific parameter is an array or \"hash\" (which I know are just objects).
<
I think the most elegant way is to simply use the instanceof
operator:
if (myVar instanceof Array)
doSomething();
examples:
[] instanceof Array // true
{} instanceof Array // false
{length:100} instanceof Array // false
null instanceof Array // false
Be aware that it will fail when testing an object from another iFrame (see answers by @galambalazs and @bobince)