title: Can i make a nested object within an array?
body: <p>So i'm wanting to do the below.</p>
  <pre><code>let listOne: any = ['item1', 'item2', 'item3'];
  let details: any;
  
  // prior to this i had a loop running and 'row' was the response that would output the items 
  // in the listOne array
  
  const query_for_details = `SELECT column1 FROM tableName WHERE itemId = '${row}'`;
  details = await client.query(query_for_details).then((res: any) =&gt; res.rows
  console.log(details)
  // Output for each item in the listOne array {name1: value1, name2: value2, name3:value3}
  </code></pre>
  <p>now what im wanting to do is once the output for the query is made i want to then add the above into a new variable like in the below section</p>
  <pre><code>let listOneDetails: any = [{'item1': {'name1': 'value1', 'name2': 'value2', 'name3':'value3'}},
  {'item2': {'name1': 'value1', 'name2': 'value2', 'name3':'value3'}},
  {'item3': {'name1': 'value1', 'name2': 'value2', 'name3':'value3'}}]
  </code></pre>
  <p>i've read about using a reducer, but I don't feel that quite works as a solution for my situation. All assistance would be appreciated!</p>