Amount of passed parameters to functions in JavaScript
<p>JavaScript is a revelation to me. I thought it would be like another sort of classical languages like C#, Java, etc. But it didn't. "Dynamic world" is tough and unpredictable. I was astonished when I read that functions can receive as many parameters as you desire. Without any error! I don't like it at all. I want more "staticness", I want some sort of compile-time errors!</p>

<p>My question is: am I need to worry about that? Is it a good practice to throw an exception if a quantity of passed parameters are more than a particular function expects?</p>

<pre><code>function foo(one, two, three)
{
    // Is it good?
    if(arguments.length &gt; arguments.callee.length)
        throw new Error("Wrong quantity of arguments in " + arguments.callee.name + "()");

    /* Stuff */
}

foo(1, 2, 3, 4); // -&gt; Error
foo(1, 2, 3);    // -&gt; OK
</code></pre>

<p>Should I be concerned about it at all?</p>

<p>Thanks in advance!</p>
