title: Merge JS objects without overwriting
body: <p>Suppose you have two objects: </p>
  
  <pre><code>var foo = {
      a : 1,
      b : 2
  };
  
  var bar = {
      a : 3,
      b : 4
  }
  </code></pre>
  
  <p>What's the best way to merge them (and allow deep merging) to create this:</p>
  
  <pre><code>var foobar = {
      a : [1, 3],
      b : [2, 4]
  }
  </code></pre>
  
  <p><em>Edit for question clarification:</em> Ideally, in the case of an existing property in one and not the other, I would expect an array to still be created, for normalization purposes and to allow for further reduction of the map, however the answers I'm seeing below are more than sufficient. For the purposes of this exercise, I was only looking for string or numerical merges, so I hadn't entertained every possible situational case. If you held a gun to my head and asked me to make a choice, though, I'd say default to arrays. </p>
  
  <p>Thanks all for your contributions.</p>