title: How does JavaScript store DOM elements in variables?
body: <p>What I mean is how does JavaScript store DOM elements when you do something like:</p>
  
  <pre><code>var foo = document.getElementsByTagName('p');
  </code></pre>
  
  <p>what does foo become? an array of objects? and how can I add more elements to that variable, for example:</p>
  
  <pre><code>var bar = document.form[0].getElementsByTagName('input'); // 5 elements
  var foo = document.form[1].getElementsByTagName('input'); // 4 elements
  
  bar =+ foo;
  
  for (i=0;i&lt;bar.length;i++){
  console.log(bar.value); // 9 logged values
  }
  </code></pre>
  
  <p>Is it possible to add more elements of the same type to a variable that already has elements in it? Do I have to loop trough all elements in the variable I want to add and "push" them in the variable I want all the data in?</p>