title: How can I Combine using Spread Operator in TypeScript for an Object
body: <p>I need to add values to a object using the Spread operator. But when I use it the previous values getting removed from the object.</p>
  
  <p>My object is like</p>
  
  <pre><code>let newObj = {
  name: 'sachin',
  lastname: 'Tendulkar',
  full_name: 'Sachin Ramesh Tendulkar',
  test: {
    test_debut: '15 November 1989 v Pakistan'
  },
  odi: {
    odi_debut: '18 December 1989 v Pakistan'
  },
  t20: {
    t20_debut: '1 December 2006 v South Africa'
  }
  }
  </code></pre>
  
  <p>to this object I need to add Some more values</p>
  
  <pre><code>{
      name: 'sachin',
      lastname: 'Tendulkar',
      full_name: 'Sachin Ramesh Tendulkar',
      Born: '24 April 1973',
      test: {
          debut: '15 November 1989 v Pakistan',
          last_match: '14 November 2013 v West Indies',
          cap: 187
      },
      odi: {
          debut: '18 December 1989 v Pakistan',
          last_match: '18 March 2012 v Pakistan',
          cap: 74
      },
      t20: {
          debut: '1 December 2006 v South Africa',
          last_match: '1 December 2006 v South Africa',
          cap: 11
      }
  }
  </code></pre>
  
  <p>so for that I added </p>
  
  <pre><code>const newValues = {
    Born: '24 April 1973',
    test: {
              last_match: '14 November 2013 v West Indies',
              cap: 187
          },
     odi: {
              last_match: '18 March 2012 v Pakistan',
              cap: 74
          },
     t20: {
              last_match: '1 December 2006 v South Africa',
              cap: 11
          }
  }
  </code></pre>
  
  <p>When I use </p>
  
  <pre><code>newObj = {...newObj , ...newValues };
  </code></pre>
  
  <p>I got below response</p>
  
  <pre><code>{
      name: 'sachin',
      lastname: 'Tendulkar',
      full_name: 'Sachin Ramesh Tendulkar',
      Born: '24 April 1973',
      test: {
          last_match: '14 November 2013 v West Indies',
          cap: 187
      },
      odi: {
          last_match: '18 March 2012 v Pakistan',
          cap: 74
      },
      t20: {
          last_match: '1 December 2006 v South Africa',
          cap: 11
      }
  }
  </code></pre>
  
  <p>How can I fix this in typeScript</p>