title: Recursive/deep extend/assign in Underscore.js?
body: <p>Is there any way to get Underscore.js <a href="http://underscorejs.org/#extend"><code>extend</code></a> function:</p>
  
  <blockquote>
    <p>Copy all of the properties in the source objects over to the
    destination object, and return the destination object. It's in-order,
    so the last source will override properties of the same name in
    previous arguments.</p>
  </blockquote>
  
  <p>... to work recursively? </p>
  
  <p>Actually, <code>query</code> property in <code>creditOperation</code> is going to completely override the <code>query</code> property defined in <code>baseOperation</code>:</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>var url = require('url')
    , _ = require('underscore'),
    , baseOperation = {
          host: 'gateway.skebby.it',
          pathname: 'api/send/smseasy/advanced/http.php',
          protocol: 'https',
          query: {
              'username': 'foo',
              'password': 'bar',
          }
      };
  
  var creditOperation = _.extend(baseOperation, {
      query: {
          'method': 'baz'
      }
  });
  
  console.log(url.format(creditOperation));
  </code></pre>
  
  <p>I'd like to obtain this <code>creditOperation</code>:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
      host: 'gateway.skebby.it',
      pathname: 'api/send/smseasy/advanced/http.php',
      protocol: 'https',
      query: {
          'username': 'foo',
          'password': 'bar',
          'method': 'baz'
      }
  }
  </code></pre>