title: How to instantiate an object in TypeScript by specifying each property and its value?
body: <p>Here's a snippet in which I instantiate a new <code>content</code> object in my service:</p>
  
  <pre><code>const newContent = new Content(
       result.obj.name
       result.obj.user.firstName,
       result.obj._id,
       result.obj.user._id,
  );
  </code></pre>
  
  <p>The problem is that this way of object instantiation relies on the order of properties in my <code>content</code> model. I was wondering if there's a way to do it by mapping every property to the value I want to set it to, for example:</p>
  
  <pre><code> const newContent = new Content(
       name: result.obj.name,
       user: result.obj.user.
       content_id: result.obj._id,
       user_id: result.obj.user._id,
   );
  </code></pre>