Typescript: Create class via constructor passing in named parameters? : <p>I have a class where I have the constructor defined with 3 parameters which are all optional. I was hoping to be able to pass in named parameters so I don't need to pass in undefined.</p>

<pre><code>constructor(year?: number,
            month?: number,
            date?: number)
</code></pre>

<p>I was hoping to create an intance of the class like so</p>

<pre><code>  const recurrenceRule = new MyNewClass(month: 6)
</code></pre>

<p>but it didn't work and i tried</p>

<pre><code>  const recurrenceRule = new MyNewClass(month = 6)
</code></pre>

<p>and that didn't work.</p>

<p>The only way i got it to work was either</p>

<pre><code>  const recurrenceRule = new MyNewClass(undefined, 4)
</code></pre>

<p>or</p>

<pre><code>  const recurrenceRule = new MyNewClass(, 4)
</code></pre>

<p>But it seems so messy, I was hoping to pass in named arguments and becasue they are all optional I should be able to just pass in 1 - right ?</p>
