title: Remove Duplicate In Array Using Pure Javascript Or Typescript
body: <p>I seem to only find ways to remove duplicates from an array using other JS libraries but I'm looking to do it in pure JS or typescript since I'm working on an Angular project.</p>
  
  <p>My problem is that I may get an array that has duplicate entries, such as this one:</p>
  
  <pre><code>data [0: {Id: 1, Definition: "House"},
        1: {Id: 1, Definition: "House"}]
  </code></pre>
  
  <p>And I want to filter it out so that I only get</p>
  
  <pre><code>data [0: {Id: 1, Definition: "House"}]
  </code></pre>
  
  <p>I've tried it using this method but I still get duplicate entries</p>
  
  <pre><code>let uniqueArray = data.filter(function(item, pos) {
      return data.indexOf(item) == pos;
  })
  </code></pre>