title: TypeError: Cannot assign to read only property
body: <p>I am trying to alter the value of an item in an object. Unfortunately, I keep getting this error:</p>
  
  <blockquote>
    <p>TypeError: Cannot assign to read only property 'completed' of object
    '[object Object]'</p>
  </blockquote>
  
  <p>Here is the model of the object:</p>
  
  <pre><code> export interface Item {
      id: string;
      name: string;
      completed: boolean;
  }
  </code></pre>
  
  <p>I have an object with values where <code>completed</code> is <code>false</code></p>
  
  <p>Now, what I want to do is change the value of completed on some function call</p>
  
  <pre><code>onClick(item: Item){
    item.completed = true;
    console.log(item);
  }
  </code></pre>
  
  <p>Calling the above method is giving me this </p>
  
  <blockquote>
    <p>TypeError: Cannot assign to read only property 'completed' of object
    '[object Object]'</p>
  </blockquote>
  
  <p>How can I change the value of <code>completed</code> in the object?</p>