title: How to validate the number of arguments in TypeScript
body: <p>I (only) use <code>arguments</code> to throw an error when an invalid number of arguments are passed to a function.</p>
  
  <pre><code>const myFunction = (foo) =&gt; {
    if (arguments.length !== 1) {
       throw new Error('myFunction expects 1 argument');
    }
  }
  </code></pre>
  
  <p>Unfortunately in TypeScript I get the error <code>The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.</code> when referenced in arrow function.</p>
  
  <p>How can I (always) validate the number of arguments in TypeScript?</p>