title: Spread operator over an array of objects in typescript
body: <p>I am trying to use <code>spread operator</code> to find a unique set on this</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let obj = {
    requests: [{
        id: 'p1',
        isOptional: false,
        item: [Object]
      },
      {
        id: 'p1',
        isOptional: false,
        item: [Object]
      }
    ]
  };
  
  // I tried below.
  let output = [...new Set(obj.requests)];
  console.log(output);</code></pre>
  </div>
  </div>
  </p>
  <p>But that did not work.</p>