Why does ",,," == Array(4) in Javascript?
<p>Boot up your interpreter/console and try the comparison</p>

<pre><code>&gt; ",,," == Array(4)
True
</code></pre>

<p>Why?  At first I thought maybe since you could think of ",,," as an array of four characters with a '\0' terminating slice, that might be why, but</p>

<blockquote>
  <p>"..." == Array(4)</p>
</blockquote>

<p>Returns "False".  So... why?  I know it's some idiosyncratic bit of duck typing in Javascript, but just curious what underlines this behavior.  Gleaned this from Zed Shaw's excellent presentation here btw: <a href="http://vimeo.com/43380467" rel="nofollow">http://vimeo.com/43380467</a></p>

<p>Thanks</p>
