title: Get a function's arity
body: <p>In Javascript, how can one determine the number of formal parameters defined for a function?</p>
  
  <p>Note, this is not the <code>arguments</code> parameter when the function is called, but the number of named arguments the function was defined with.</p>
  
  <pre><code>function zero() {
      // Should return 0
  }
  
  function one(x) {
      // Should return 1
  }
  
  function two(x, y) {
      // Should return 2
  }
  </code></pre>