How can I implement an optional argument in javascript?
<p>I have the following method:</p>

<pre><code>function addCity ( name, size ) {

}
</code></pre>

<p>Is there some way that I could make this default to a size of "M" if the user does not specify the second argument?</p>

<p>I saw an example that suggested the following but I am not sure if it is correct of if this is the way to do this:</p>

<pre><code>function addCity ( name, { size: "M" } ) {

}
</code></pre>
