title: How to remove duplicates from an object array using spread operator
body: <p>I have below object array with id as unique key":</p>
  
  <pre class="lang-js prettyprint-override"><code>var test = [
    {id: 1, PlaceRef: "*00011", Component: "BATH", SubLocCode: "BAT", BarCode: ""},
    {id: 2, PlaceRef: "*00022", Component: "BAXI10R", SubLocCode: "KIT", BarCode:""},
    {id: 1, PlaceRef: "*00011", Component: "BATH", SubLocCode: "BAT", BarCode: ""},
    {id: 3, PlaceRef: "*00011", Component: "ANR190", SubLocCode: "B1", BarCode: ""}
  ]
  </code></pre>
  
  <p>From this I want to retrieve unique objects using spread operator, I have tried using below code:</p>
  
  <pre><code>const uniKeys = [...(new Set(test.map(({ id }) =&gt; id)))];
  </code></pre>
  
  <p>I am able to retrieve id's only, how can I retrieve the unique objects using spread operator. Also, any new ES6 features implementation would be helpful.</p>