Confused About Resig Curry Example And "arguments" Object
<p>In <a href="http://ejohn.org/blog/partial-functions-in-javascript" rel="nofollow">this article</a>, John Resig discusses this snippet for currying:</p>

<pre><code>Function.prototype.curry = function() {
    var fn = this, args = Array.prototype.slice.call(arguments);
    return function() {
      return fn.apply(this, args.concat(
        Array.prototype.slice.call(arguments)));
    };
  };
</code></pre>

<p>I am confused about the expression <code>Array.prototype.slice.call(arguments)</code>.  </p>

<ol>
<li><p>Here "arguments" is the "this" argument to Array's slice() method, but "slice()" requires an argument itself, so I would think you'd need to do something like <code>Array.prototype.slice.call(arguments, &lt;someIndex&gt;)</code>. I don't understand how that code can be working as is.  </p></li>
<li><p>According to <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Functions_and_function_scope/arguments" rel="nofollow">the docs on "arguments"</a>, "arguments" is not actually an Array, but only an array like object.  How are we calling "slice()" on it?  And if I put in the code <code>console.log(arguments.slice())</code> I get an error saying that the object does not have a slice method. </p></li>
</ol>

<p>What's going on here?</p>
