title: Fill array in a for loop
body: <p>I'm trying to fill a new array within a loop, but I can't figure it out.</p>
  
  <p>What I need is, that I filter all value's from my temporary array to set to my new array.
  all value's that start with "+" need to get into the array "my_hash_plus". 
  this is what I have now.</p>
  
  <pre><code>var my_hash_plus = new Array;   
  $.each(my_hash_plus_tmp, function(_, temp) {
      if (tmp[0] == "+") {
          my_hash_plus[] = temp;
      }
  });
  </code></pre>
  
  <p>I noticed that I can't fill my array with <code>[]</code> in js, but if I those things then <code>my_hash_plus</code> becomes a normal var... So my question is: what is the best way to get all the value's from the array <code>my_hash_plus_tmp</code> that start with "+" into a new array (which I will call <code>my_hash_plus</code>)</p>