title: Removing an argument from arguments in JavaScript
body: <p>I wanted to have an optional <code>boolean</code> parameter to a function call:</p>
  
  <pre><code>function test() {
    if (typeof(arguments[0]) === 'boolean') {
      // do some stuff
    }
    // rest of function
  }
  </code></pre>
  
  <p>I want the rest of the function to only see the <code>arguments</code> array <strong>without</strong> the optional <code>boolean</code> parameter. First thing I realized is the <code>arguments</code> array isn't an array! It seems to be a standard <code>Object</code> with properties of 0, 1, 2, etc. So I couldn't do:</p>
  
  <pre><code>function test() {
    if (typeof(arguments[0]) === 'boolean') {
      var optionalParameter = arguments.shift();
  </code></pre>
  
  <p>I get an error that <code>shift()</code> doesn't exist. So is there an easy way to remove an argument from the beginning of an <code>arguments</code> object?</p>