title: Unlimited arguments in a JavaScript function
body: <p>Can a JavaScript function take unlimited arguments?
  Something like this:</p>
  
  <pre><code>testArray(1, 2, 3, 4, 5...);
  </code></pre>
  
  <p>I am trying:</p>
  
  <pre><code>var arr = [];
  function testArray(A) {
      arr.push(A);
  }
  </code></pre>
  
  <p>But this doesn't work (output is only the first argument). Or the only way is:</p>
  
  <pre><code>function testArray(a, b, c, d, e...) {
  
  }
  </code></pre>
  
  <p>Thanks</p>