Why isn't [1,2,3] equal to itself in Javascript?
<p>I was playing around with arrays in Javascript today and noticed this little gem:</p>

<pre><code>alert([1, 2, 3] == [1, 2, 3]); //alerts false
</code></pre>

<p>It strikes me as rather odd that the array is not equal to itself.</p>

<p>But then I noticed this, which was even weirder:</p>

<pre><code>alert([1, 2, 3] == "1,2,3");  //alerts true
</code></pre>

<p><strong>?!?!?!?!!!?</strong></p>

<p>Why in the world is <code>[1, 2, 3]</code> not <code>==</code> to itself but is <code>==</code> to the string?</p>

<p>I realize that <code>==</code> is <a href="http://www.webreference.com/js/column26/stricteq.html" rel="nofollow">not the same</a> as <code>===</code>. Even so, what evilness could cause Mr. Javascript do such weird things?</p>
