title: Javascript - Storing array of objects in hidden field
body: <p>I need to store some input in a hidden field, so when I print the post-request, I get:</p>
  
  <pre><code>Array ( [0]=&gt;1 [1]=&gt;2 [2]=&gt;3 )
  </code></pre>
  
  <p>I already tried:</p>
  
  <pre><code>var elems = [];
  elems.push['1'];
  elems.push['2'];
  elems.push['3'];
  
  $('#input_hidden_field').val(elems);
  </code></pre>
  
  <p>But it does not work, anybody could help me with this?</p>