title: Merging two arrays of objects
body: <p>I have a bit of a problem where I am struggling on for a pretty long time now. I have two arrays:</p>
  
  <p><code>var arr1 = [{"x":1,"y":1,"value":null},{"x":2,"y":1,"value":null},{"x":3,"y":1,"value":null},{"x":4,"y":1,"value":null},{"x":5,"y":1,"value":null},{"x":1,"y":2,"value":null},{"x":2,"y":2,"value":null},{"x":3,"y":2,"value":null},{"x":4,"y":2,"value":null},{"x":5,"y":2,"value":null},{"x":1,"y":3,"value":null},{"x":2,"y":3,"value":null},{"x":3,"y":3,"value":null},{"x":4,"y":3,"value":null},{"x":5,"y":3,"value":null},{"x":1,"y":4,"value":null},{"x":2,"y":4,"value":null},{"x":3,"y":4,"value":null},{"x":4,"y":4,"value":null},{"x":5,"y":4,"value":null},{"x":1,"y":5,"value":null},{"x":2,"y":5,"value":null},{"x":3,"y":5,"value":null},{"x":4,"y":5,"value":null},{"x":5,"y":5,"value":null}];</code></p>
  
  <p><code>var arr2 = [{"x":1,"y":1,"value":13},{"x":1,"y":3,"value":3},{"x":2,"y":2,"value":146},{"x":2,"y":3,"value":44},{"x":2,"y":4,"value":42},{"x":2,"y":5,"value":5},{"x":3,"y":2,"value":14},{"x":3,"y":3,"value":57},{"x":3,"y":4,"value":23},{"x":3,"y":5,"value":15},{"x":4,"y":2,"value":1},{"x":4,"y":3,"value":4},{"x":4,"y":4,"value":8},{"x":4,"y":5,"value":1},{"x":5,"y":4,"value":1},{"x":5,"y":5,"value":8}]</code>;</p>
  
  <p>Where <code>arr1</code> always contains 25 objects and <code>arr2</code> contains a variable number of objects, but they are always formatted the same. </p>
  
  <p>How do I combine both arrays into one, where for example:</p>
  
  <p><code>{"x":1,"y":1,"value":null}</code> from arr1 will be <code>{"x":1,"y":1,"value":13}</code> as a result, but <code>{"x":2,"y":1,"value":null}</code> from arr1 will stay the same, since arr2 does not have this object. </p>
  
  <p>After merging it would be most ideal to have an array of 25 objects, where the field <code>"value"</code> is filled from the objects out of arr2.</p>
  
  <p><strong>EDIT</strong>
  Alright, since I am getting a lot of downvotes, you can find my code on <a href="http://jsfiddle.net/Warforce/Z5Gmk/11/" rel="nofollow">JSFiddle</a></p>
  
  <p>Any help is very much appreciated!</p>