title: Compare two Arrays with Objects and create new array with unmatched objects
body: <p>I have the following two Javascript arrays:</p>
  
  <pre><code>const array1 = [{ id: 1}, { id: 2 }, { id: 3 }, { id: 4}];
  const array2 = [{ id: 1}, { id: 3 }];
  </code></pre>
  
  <p>I now want a new array <code>array3</code> that contains only the objects that aren't already in <code>array2</code>, so:</p>
  
  <pre><code>const array3 = [{ id: 2}, { id: 4 }];
  </code></pre>
  
  <p>I have tried the following but it returns all objects, and when I changed the condition to <code>===</code> it returns the objects of <code>array2</code>.</p>
  
  <pre><code>const array3 = array1.filter(entry1 =&gt; {
    return array2.some(entry2 =&gt; entry1.id !== entry2.id);
  });
  </code></pre>
  
  <p>Any idea? ES6 welcome</p>