Why does typescript allow default parameters before required parameters?
<p>i just noticed , that this function (using default params) doesn't cause error on compilation.</p>

<pre><code>function buildAddress(address1 = 'N/A', address2: string) {
        displayAddress( address1 +' '+ address2);
    }
</code></pre>

<p>but this function (using optional params) does.</p>

<pre><code>function buildAddress(address1?: string, address2: string) {
        displayAddress( address1 +' '+ address2);
    }
</code></pre>

<p>why is it so ?</p>

<p>i'm really surprised of this behavior, is that normal ? does it have any benefit ? is this a feature or a bug ?</p>