Code on MDN: how does this IE specific shim for setTimer work?
<p>On <a href="https://developer.mozilla.org/en-US/docs/DOM/window.setTimeout#Callback_arguments" rel="nofollow">MDN's page for setTimer</a>, there is a little shim / compatibility layer for setTimer that will let Internet Explorer accept additional arguments in the setTimer method that will be passed to the callback.</p>

<p>I pretty much understand all of the code below:</p>

<pre><code>if (document.all &amp;&amp; !window.setTimeout.isPolyfill) {
  var __nativeST__ = window.setTimeout;
  window.setTimeout = function (
                          vCallback, 
                          nDelay /*, 
                          argumentToPass1, 
                          argumentToPass2, etc. */
                          ) {
    var aArgs = Array.prototype.slice.call(arguments, 2);
    return __nativeST__(vCallback instanceof Function ? function () {
      vCallback.apply(null, aArgs);
    } : vCallback, nDelay);
  };
  window.setTimeout.isPolyfill = true;
}
</code></pre>

<p>Except for one line:</p>

<pre><code>var aArgs = Array.prototype.slice.call(arguments, 2);
</code></pre>

<p>It references <code>arguments</code>, but I cannot see that name being referenced anywhere before this line. It is not on the <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Reserved_Words" rel="nofollow">Reserved words</a> list either, so it does not seem to be <em>magic</em> in any way. In order for me to make any sense out of it, it must somehow refer to the arguments of the overridden setTimeout function, and then use <code>slice()</code> to get every argument after the first two. </p>
