title: How to assign an object with more fields to another object with less fields without adding extra fields to first object?
body: <p>I have an object as:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>secondObject {
    name: value,
    userName: value,
    userId; value,
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>And I have a pre-defined Model whose instance I am creating as </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let modelObject: Model.</code></pre>
  </div>
  </div>
  </p>
  
  <p>The Model is defined as follows</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    userName,
    userId
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Basically both models have some common fields and same data type since the first object I have described is just an extension of a join query on the Model and some other data, resulting into having an object that has all the fields of the Model plus some more.</p>
  
  <p>What I want to do is:- </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let thirdObj: Model;
  obj = object</code></pre>
  </div>
  </div>
  </p>
  
  <p>The 'object' above is one with the extra fields</p>
  
  <p>and <strong>NOT</strong> get the obj as:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
        name: null,
        userName: value,
        userId; value,
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>But instead GET:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
  userName: value,
  userId: value
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Any ideas how I can achieve this?</p>