title: Combine 2 json objects into a single one in node.js
body: <p>I have 2 json objects in node.js</p>
  
  <pre><code>x= { '20': { length: '2', payload: [ '11', '22' ] } };
  y= { '23': { length: '2', payload: [ 'ef', 'ab' ] } };
  </code></pre>
  
  <p>I want to combine them such that they become;</p>
  
  <pre><code>z= 
  {
      '20': { length: '2', payload: [ '11', '22' ] },
      '23': { length: '2', payload: [ 'ef', 'ab' ] },
  };
  </code></pre>
  
  <p>How can this be done in node.js?</p>
  
  <hr>
  
  <p>EDIT: I found an easy answer myself. Cannot answer as question has been marked as duplicate.</p>
  
  <p>Use underscore module. </p>
  
  <pre><code>var _under = require("underscore");
  
  z= _under.extend(x, y);
  </code></pre>