Create an object based on 2 others
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://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>I have two objects a and b defined like this:</p>

<pre><code>a = { 
  a: 1, 
  af: function() { console.log(this.a) }, 
};
b = { 
  b: 2, 
  bf: function() { console.log(this.b) },
};
</code></pre>

<p>What I want now is to create another object which will get the properties of a and b, like this:</p>

<pre><code>c = { 
  a: 1, 
  af: function() { console.log(this.a) },
  b: 2, 
  bf: function() { console.log(this.b) },
}
</code></pre>

<p>Note that a and b need to stay the same.</p>

<p>Any idea of how to do this ?</p>
