How to define optional constructor arguments with defaults in Typescript : <p>Is it possible to have optional constructor arguments with default value, like this</p>

<pre><code>export class Test {
    constructor(private foo?: string="foo", private bar?: string="bar") {}
}
</code></pre>

<p>This gives me the following error: </p>

<p>Parameter cannot have question mark and initializer.</p>

<p>I would like to create instances like </p>

<pre><code>x = new Test();               // x.foo === 'foo'            
x = new Test('foo1');         // x.foo === 'foo1'
x = new Test('foo1', 'bar1');
</code></pre>

<p>What is the correct typescript way to achieve this?</p>
