title: Typescript convert an array to JSON
body: <p>I have a complicated data structure that I need to convert to JSON.  The problem is that my field names and values are in an array.</p>
  
  <p>For instance, I have the following (simplified from my code base):</p>
  
  <pre><code>let SampleData = [
          { Field: 'Key', Value: '7'},
          { Field: 'City', Value: 'Some City'},
          { Field: 'Description', Value: 'Some Description'}
  ];
  </code></pre>
  
  <p>Basically my data is an array where the first element is the database column name, and the second element is the data in the column.  I am trying to get a JSON object that is:</p>
  
  <pre><code>{ Key: 7, City: 'Some City', Description: 'Some Description' }
  </code></pre>
  
  <p>My real code has the fields and data is structures within the object, so I cannot simply use an Object.create() or Object.assign() as far as I can get working.</p>
  
  <p>I have tried looping through to build a simple string and then use the JSON.parse to break it apart, but this seems like a lot of overhead for something I would have thought would be simpler.</p>