Javascript: Equality Comparison between two Object/ Array
<p>Let us guess two objects with same property:</p>

<pre><code>var x = {a : 'some'},
      y = {a: 'some'};
</code></pre>

<p>output:</p>

<p><code>x == y;</code> and <code>x === y;</code> both give false</p>

<p>Similarly for two array,</p>

<pre><code>var p = [1, 2, 3],
      q = [1,2,3];
</code></pre>

<p><code>p == q</code> and <code>p === q</code> both give <code>false</code>.</p>

<p>But for if I do following:</p>

<pre><code>var x = y = {a: 'some'};
var p = q = [1, 2, 3];
</code></pre>

<p>All above comparison give <code>true</code>.</p>

<p>Why Javascript do such thing? Explain Please.</p>
