es6 unique array of objects with set
<p>I came across this example for creating unique arrays with es6</p>

<pre><code>[ ...new Set(array) ]
</code></pre>

<p>Which seems to work fine until I tried it with an array of objects and it didn't return unique array.</p>

<p>i.e.</p>

<pre><code>let item = [ ...new Set([{id:123,value:'test'},{id:123,value:'test'}]) ];
</code></pre>

<p>Why is that ?</p>