title: How do you use the arguments keyword in Node.js?
body: <p>In JavaScript, the <code>arguments</code> keyword is useful for getting information about a function's arguments. It's 'array-like' in that it can be indexed like an array, but <code>Array.isArray</code> will return <code>false</code> on it. </p>
  
  <p>I'm trying to use <code>arguments.length</code> in a function I am exporting via <code>module.exports</code> like so: </p>
  
  <pre><code>module.exports.foo = (args) =&gt; {
      console.log(arguments.length); 
  }
  </code></pre>
  
  <p><strong>The problem:</strong> arguments.length <strong>always</strong> prints 5. When I actually go to print <code>arguments</code> itself, I see that it is an array-like object containing the following: </p>
  
  <p>0: an array of things I'm exporting from the current module (in this case, an array of all of my functions.</p>
  
  <p>1: the <code>require</code> function</p>
  
  <p>2: an object containing information about the current module, like what it's exporting, the including module, file paths, etc. </p>
  
  <p>3: he path to the current module </p>
  
  <p>4: the path to the directory containing the current module </p>
  
  <p>The problem is <code>arguments</code> in this context doesn't work like I expect it to. No matter how many arguments I pass in to the function call, it always prints 5. </p>
  
  <p>How do you properly use the <code>arguments</code> keyword in Node.js exported functions? </p>