Passing variable number of arguments from one function to another
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1959040/is-it-possible-to-send-a-variable-number-of-arguments-to-a-javascript-function">Is it possible to send a variable number of arguments to a JavaScript function?</a>  </p>
</blockquote>



<p>I can use <code>arguments</code> to get a variable number of arguments within a function, but how can I pass them to another function without knowing its prototype?</p>

<pre><code>function show(foo, bar) { window.alert(foo+' '+bar); }
function run(f) { f(arguments); } // not correct, what to do?
run(show, 'foo', 'bar');
</code></pre>

<p>Note: I cannot guarantee the number of arguments needed for the function <code>f</code> that is passed to <code>run</code>. Meaning, even though the example shown has 2 arguments, it could be 0-infinite, so the following <strong>isn't</strong> appropriate:</p>

<pre><code>function run(f) { f(arguments[1], arguments[2]); }
</code></pre>
