Javascript: arguments change with further apply processing
<pre><code>    function Foo(){

    }
    Foo.prototype={
        method1:function(o){
            console.log(o);
        }
        ,shorthand:function(){
            if(!arguments.length || typeof arguments[0]=='undefined') {
                arguments[0]={};
            }
            arguments[0].bar='test';
            return this.method1.apply(this,arguments);
        }
    }

    var instance=new Foo();
    instance.shorthand();

console.log(o); // returns undefined
</code></pre>

<p>After a while i figured out, that assigning arguments an array fixes this.</p>

<pre><code>arguments=[{bar:'test'}];
</code></pre>

<p>I figured out, that arguments is not an array after all, or semi-array. Well it doesn't have push method.</p>

<p>Why is it doing so(i mean returns undefined)? It's been made for some purpose?</p>
