title: How do you combine two objects in Javascript?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically">How can I merge properties of two JavaScript objects dynamically?</a>  </p>
  </blockquote>
  
  
  
  <p>If I have two Javascript objects which I am using as a list of key-value pairs:</p>
  
  <pre><code>var a = {a:1};
  var b = {b:2};
  </code></pre>
  
  <p>what is the most efficient way to combine them into a third object which contains the properties of both?</p>
  
  <pre><code>var c = {a:1, b:2};
  </code></pre>
  
  <p>I don't mind if either or both of <code>a</code> and <code>b</code> are modified in the process.</p>