In Typescript how to fix Cannot set property 'first' of undefined
<p>I'm trying to set a the sub property <code>first</code> that is defined in the <code>Name</code> interface but when do so I always get an error for example:</p>

<pre><code>interface Name{
    first: string,
    last:string,
}

class Person{

    private name:Name

    public setName(firstName, lastName){
        this.name.first = firstName;
        this.name.last = lastName;
    }

}


var person1  = new Person();
person1.setName('Tracy','Herrera');
</code></pre>

<p>When running it i get the error: <code>Cannot set property 'first' of undefined</code></p>

<p>Any one have an idea to work this out?</p>