title: How to combine two interfaces and make all of its fields optional?
body: <p>I have two interfaces <strong>that cannot be modified</strong>:</p>
  
  <pre><code>interface Person {
    name: string;
    age: number;
  }
  interface User {
    username: string;
    password: string;
  }
  </code></pre>
  
  <p>I want to combine them into just one: <code>Player</code></p>
  
  <pre><code>// please, modify this code accordingly
  
  interface Player extends Person, User {
    device: string
  }
  </code></pre>
  
  <p>where <code>name</code> and <code>age</code> are optional.</p>
  
  <p>So, if I do this:</p>
  
  <pre><code>const member: Player = {
    username: 'bill.gates',
    password: 'M1cRoS0ft',
    device: 'PSP',
  }
  </code></pre>
  
  <p>then I don't get an error because: <code>name</code> and <code>age</code> are missing.</p>
  
  <p>Here you have the <a href="http://www.typescriptlang.org/play/?ssl=1&amp;ssc=1&amp;pln=20&amp;pc=1#code/JYOwLgpgTgZghgYwgAgArQM4HsTIN4BQyyIcAthAFzIZhSgDmA3EcnA1SQK5kBG0LAL4ECoSLEQoAqhmj5WXWVFIVqteiGasADnAwYA7ligATNXUZCRY6PCRoANnACeciAA9IIExjSYcADTIMnKExCYQAG7ASOYaDATCBAg4tMgUfNDUqE6uUMgAvPLEitAqnADkvMAODgB0DHCQGBUBOnqGxmbIFQCyAIwIAEpYAMoADDBgrawR0bE9qKOoM8JAA" rel="nofollow noreferrer">Playground</a>.</p>
  
  <p>Thanks!</p>