title: jQuery extend multiple objects with the same function
body: <p>So I'm using $.extend to combine multiple components (objects).  Some of these components have a function with the same key.  I want the final extended object to have that same key, but have it point to a function which calls all of the merged components' versions of the functions one after the other.</p>
  
  <p>So it'd look something like this:</p>
  
  <pre><code>var a = { foo: function() { console.log("a"); } };
  var b = { foo: function() { console.log("b"); } };
  var c = {}; // Doesn't have foo
  
  var d = $.extend({}, a, b, c);
  var e = $.extend({}, a, c);
  var f = $.extend({}, c);
  
  d.foo(); // Should call function() { console.log("a"); console.log("b"); }
  e.foo(); // Should call function() { console.log("a"); }
  f.foo(); // Should call function() {}
  </code></pre>
  
  <p>Is there a pragmatic way of doing this?  I only want to do this for a specific set of keys, so I would only want to merge those specific keys' functions together and let the ordering in extend overwrite anything else.</p>
  
  <p>Hopefully that makes sense :S</p>