title: Merging two object arrays by removing duplicates Javascript Jquery
body: <p>How to merge two object arrays with no two elements with same key 'id'?</p>
  
  <pre><code>var array1 = [{id:"1", expected:"aaa", actual:"xxx"}, {id:"2", expected:"bbb", actual:"yyy"}];
  var array2 = [{id:"1", expected:"kkk", actual:"xxx"}, {id:"4", expected:"ccc", actual:"zzz"}];
  </code></pre>
  
  <p>And the result array should be,</p>
  
  <pre><code>var array3 = [{id:"1", expected:"kkk", actual:"xxx"}, , {id:"2", expected:"bbb", actual:"yyy"}, {id:"4", expected:"ccc", actual:"zzz"}];
  </code></pre>
  
  <p>The element with id "1" should be added from array2.</p>