Get function parameter names for interface purposes
<p>can anyone help me on how to retrieve function parameter names? For example:</p>

<pre><code>var A = function(a, b, c) {};
</code></pre>

<p>I need to get the parameter names outside the function, which is <strong>a</strong>, <strong>b</strong>, and <strong>c</strong> (as in literally as strings, such as to be put in an array ["<strong>a</strong>", "<strong>b</strong>", "<strong>c</strong>"]), so I can validate not only object/class properties in a class towards an interface, but also the parameters.</p>

<hr>

<p>Before this question starts raising confusion, let me explain about interface implementation in my term and the reason why I need the answer of the question above:</p>

<p>First of all, I found one interesting way I would like to use in implementing interface by Glen Ford in JavaScript:</p>

<pre><code>for (var member in theInterface) {
    if ( (typeof theObject[member] != typeof theInterface[member]) ) {
        alert("object failed to implement interface member " + member);
        return false;
    }
}
</code></pre>

<p>(Please see the detail about the implementation from <a href="http://knol.google.com/k/programming-to-the-interface-in-javascript-yes-it-can-be-done-er-i-mean-faked#" rel="nofollow">http://knol.google.com/k/programming-to-the-interface-in-javascript-yes-it-can-be-done-er-i-mean-faked#</a>).</p>

<p>However, the implementation above only validates the object properties (variable and methods) only, which is not enough for me.</p>

<p>I need more validation to parameter level, so that the code that implements one interface should follow the interface methods and also follow the parameters from the interface methods as well.</p>

<hr>

<p>PS. Please don't argue about why use interface or why it's useless or useful; instead it's most useful if you can provide better interface implementation. The focus here is I just need to know how to get function parameter names.</p>
