In Typescript, why am I required to set the property of a class that is defined as read-only?
<p>I have the following class definition:</p>

<pre><code>class Department
{
    name: string;
    id: string;

    get prefix(): string
    {
        return  !isNaN(parseFloat(this.id)) ? "n" : "i" ;
    }
}
</code></pre>

<p>Elsewhere in my code, I try to use it like this:</p>

<pre><code>getDepartmentList(): Department[] {
    return [
        {
            "name": "Dept 1",
            "id": "1000"
        }
    ];
}
</code></pre>

<p>However, I get the following error:</p>

<blockquote>
  <p>Type '{ "name": string; "id": string; }' is not assignable to type
  'Department'. Property 'prefix' is missing in type '{ "name": string;
  "id": string; }'.</p>
</blockquote>

<p>I am sure the real problem is my lack of understanding of Typescript, but can someone explain why the compiler sees the getter function as a property and expects me to set a value on it?</p>