Differentiating between arrays and "hashes" in Javascript
<p>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).</p>

<p>Typeof doesn't work, because they both return the same thing</p>

<p><code>typeof {foo:"bar"} // Object</code></p>

<p><code>typeof ["foo","bar"] // Object</code></p>

<p>So how would I differentiate between the two?</p>

<p>I know this <em>works</em>, but I'm hoping there's a nicer way</p>

<p><code>({foo:"bar"}).constructor // Object()</code></p>

<p><code>(["foo","bar"]).constructor // [ undefined ]</code></p>

<p><strong>EDIT</strong>
Ah, it seems [ undefined ] in firebug is the same thing as Array. Kind of weird.</p>
