title: TypeScript- How to add a Key Value pair to each object in an Array?
body: <p>I have an array of dates and an array of objects. I'd like to add the dates to the array of objects as a key value pair <code>{"Date": "10-12-18"}</code>. </p>
  
  <p><strong><code>dates</code></strong>:</p>
  
  <pre><code>["10-12-18", "10-13-18", 10-14-18"]
  </code></pre>
  
  <p><strong><code>data</code></strong>:</p>
  
  <pre><code>[
     {"name":"One", "age": "4"},
     {"name":"Two", "age": "5"},
     {"name":"Three", "age": "9"}
  ]
  </code></pre>
  
  <p>I want something like...</p>
  
  <pre><code>[
      {"name":"One", "age": "4", "Date": "10-12-18"},
      ....
  </code></pre>
  
  <p>How can I do this in TypeScript? I'm used to normal JavaSCript and can't get it right.</p>
  
  <p>Something I have so far:</p>
  
  <pre><code>for (let idx of data){
     data[idx].date = dates[idx] 
  }
  </code></pre>
  
  <p>Thanks!!</p>