title: What is the purpose of Object.assign() in the constructor of a Typescript object?
body: <p>Somewhere along the way, I added a constructor to my <code>Todo</code> class:</p>
  
  <pre><code>export class Todo {
    id: number;
    title: string;
    complete: boolean = false;
    editMode: boolean = false;
  
    constructor(values: Object = {}) {
      Object.assign(this, values);
    }
  }
  </code></pre>
  
  <p>I don't understand the purpose of the code in the constructor. </p>
  
  <p>My application seems to work both with and without it, but I am hesitant to remove the code</p>
  
  <p>What is the purpose of Object.assign(...) in this constructor?</p>