title: How to concatenate two arrays in NodeJS / ExpressJS
body: <p>What is the most expedient means of merging two identical JSON arrays on in a NodeJS / Express app?  I have three web services... two data api services and one "wrapper" service.  Both data services have identical objects and schemas (pulling from Mongo via Mongoose).  I would like the "wrapper" service to make calls to BOTH data services and send back the results as one combined response.</p>
  
  <p>The objects are both identical:</p>
  
  <pre><code>{
      "items": [
          {
              "_id": "14e016a2-9eb8-4f83-b597-bda8ad747adb",
              "name": "Item A 01",
              "__v": 0
          },
          {
              "_id": "4040c450-4624-4341-9a80-211814d630ab",
              "name": "Item A 02 - Renamed",
              "__v": 0
          },
          {
              "_id": "4fc4e0f7-36bc-4a87-a280-97e4f84a4a43",
              "name": "Item A 04 - Renamed",
              "__v": 0
          }
      ]
  }
  </code></pre>
  
  <p>I'm trying to combine both result sets:</p>
  
  <pre><code>    request('http://localhost:8080/itemsa', function(err, response, body){
          if (err || response.statusCode != 200){ res.status(500).send({ message: 'Failure service 01' }); return; }
  
          var objA = JSON.parse(body);
  
          request('http://localhost:8081/itemsb', function(err, response, body) {
              if (err || response.statusCode != 200) {
                  res.status(500).send({message: 'Failure service 02'});
                  return;
              }
  
              var objB = JSON.parse(body);
  
              var objC = {
                  items: []
              };
  
              objC.items.concat(objA.items);
              objC.items.concat(objB.items);
  
              res.send(objC);
          });
      });
  </code></pre>
  
  <p>However, I cannot find a concat or merge operation that works:</p>
  
  <pre><code>{
      "items" : [ ]
  }
  </code></pre>