How can you do something with each argument in a JavaScript function?
<p>Given this function:</p>

<pre><code>function foo( a,b,c ) {
    //
}
</code></pre>

<p>How can you do something, say use console.log() for each argument? I know you can see the arguments by using the arguments keyword. Arguments seems to return what looks like an Array (but is of type "object" [suprise.. not]) but it doesn't support .forEach, I am using Chrome.</p>

<p>I tried modifying the function to this, and expected it to work:</p>

<pre><code>function foo( a,b,c ) {
    arguments.forEach(function( arg ){
        console.log( arg );
    });
}
</code></pre>

<p>You get the error that TypeError: Object # has no method 'forEach'.</p>
