title: A question about JavaScript's slice and splice methods
body: <p>I came across the following code:</p>
  
  <pre><code>var f = function () {
      var args = Array.prototype.slice.call(arguments).splice(1);
  
      // some more code 
  };
  </code></pre>
  
  <p>Basically, the result in <code>args</code> is an array that is a copy of the <code>arguments</code> without its first element.</p>
  
  <p>But what I can't understand exactly is why <code>f</code>'s <code>arguments</code> (which is an object that holds the function's inputted arguments into an array-like object) object is being passed to the <code>slice</code> method and how <code>slice(1)</code> is removing the first element (positioned at index 0).</p>
  
  <p>Can anyone please explain it for me? </p>
  
  <p><em>P.S.  The code is from this <a href="https://stackoverflow.com/questions/373157/how-can-i-pass-a-reference-to-a-function-with-parameters">partial application function</a></em></p>