Does javascript allow me to use default parameters?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/148901/is-there-a-better-way-to-do-optional-function-parameters-in-javascript">Is there a better way to do optional function parameters in Javascript?</a><br>
  <a href="http://stackoverflow.com/questions/894860/how-do-i-make-a-default-value-for-a-parameter-to-a-javascript-function">How do I make a default value for a parameter to a javascript function</a>  </p>
</blockquote>



<p>I have the following function:</p>

<pre><code>function gridClick(link, action) {
   ...
   ...
</code></pre>

<p>Called like this:</p>

<pre><code>gridClick(this, action)
</code></pre>

<p>I would now like to add another parameter to the function to make it like this:</p>

<pre><code>function gridClick(link, action, mce) {
   ...
   ...
</code></pre>

<p>If I do this then will I need to change all the function calls or is there some way that I can have the function default to the value of true for the parameter mce if the function is called with just the first two arguments?</p>
