title: lodash/underscore; compare two objects and remove duplicates
body: <p>As you can see in the image below, I have some returned json <code>data</code> with three objects; each contains a clients id => data.</p>
  
  <p><img src="https://i.stack.imgur.com/6r6aq.png" alt="Returned json data"></p>
  
  <pre><code>exact_match : {104}
  match_4 :  {104, 103}
  match_2 :  {104, 103, 68}
  </code></pre>
  
  <p>How can I "trim" or remove the duplicate objects based on previous ones? something like:</p>
  
  <pre><code>exact_match : {104}
  match_4 :  {103}
  match_2 :  {68}
  </code></pre>
  
  <p>I tried <a href="https://lodash.com/docs#difference" rel="nofollow noreferrer">_.difference</a> but did not work (Maybe because it is for arrays not objects?):</p>
  
  <pre><code>var exact_match = data.exact_match,
      match_four_digits = _.difference(data.match_4, data.exact_match),
      match_two_digits = _.difference(data.match_2, data.exact_match, data.match_4),
  </code></pre>
  
  <p>Any help would be appreciated :)</p>
  
  <p><strong>Update</strong></p>
  
  <p>I need that the returned value has the same object data instead of a new array :)</p>