title: TypeScript: Why am I able to modify `readonly` property in constructor?
body: <p>I have the following TypeScript snippet:</p>
  <pre class="lang-ts prettyprint-override"><code>class Jedi { 
    private readonly name: string = 'Skywalker';
    constructor(name: string) { 
      this.name = name; //Why I am able to modify name.
    }
    toString():string {
      return this.name;
    }
  }
  
  var jedi = new Jedi('Kenobi');
  
  console.log(jedi.toString()); //Kenobi
  </code></pre>
  <p>As you can see in the code, I have declared <code>name</code> property as <code>readonly</code>. As per my knowledge <strong>to declare properties as constant we use <code>readonly</code> in TypeScript</strong>. Once we declare it with initialization, we can not modify it.</p>
  <p>But as you can see in the <code>constructor</code> it's being modified. Also TypeScript compiler also does not warn about it. Not sure whether it's a bug in TypeScript or it's intentional. Can anyone please explain?</p>