title: Javascript: how to join two arrays
body: <p>I know this has been asked a lot of times, but I cannot get it to work.</p>
  
  <p>I have an empty array <code>a</code>  </p>
  
  <pre><code>var a = [];
  </code></pre>
  
  <p>and an array with an object <code>b</code></p>
  
  <pre><code>var b = [{
     title: 'test'
  }]
  </code></pre>
  
  <p>I want to join them so <code>a</code> will look exactly like <code>b</code>.
  The idea is to do this inside a <code>for loop</code> so <code>a</code> would be added a new item each time.</p>
  
  <p>By using <code>a.concat(b)</code>, <code>a</code> results in an empty array.</p>
  
  <p>Not sure what I am missing.</p>