Comparing similar objects of different instances in javascript
<p>I had always wondered why this :</p>

<pre><code>var a = [[0, 1]];
a[0] == [0, 1];
</code></pre>

<p>would return <code>false</code>. It seems like these 2 arrays, a[0] and [0, 1], despite not being the same instance of Array, ARE actually the same object, in so far as all their properties are the same. This is not the case in JS though and I don't know why.</p>

<p>Which test applied to these two arrays, and to much more complicated objects, would return true ? (answers from jQuery and D3.js are accepted, I don't plan on using any other)</p>

<p>Edit: wrapping the objects with JSON.stringify seems to work; are there any caveats I should be aware of though?</p>
