title: Javascript iterate over array of hash and get keys
body: <p>I have build my own application using NodeJs with MySQL database. When I fetch a table I am getting some set of value which will look like this. My actual requirement is I need to get keys of hashes from this array. </p>
  
  <pre><code> [ RowDataPacket { FieldName: 'aoc_com', Input: 'ipc3' },
    RowDataPacket { FieldName: 'build', Input: 'RH' },
    RowDataPacket { FieldName: 'daq_type', Input: 'Full' },
    RowDataPacket { FieldName: 'endingport', Input: '8030' },
    RowDataPacket { FieldName: 'id_type', Input: 'TAM9' },
    RowDataPacket { FieldName: 'od_build_type', Input: 'Test_OD' },
  </code></pre>
  
  <p>First I tried to remove <code>RowDataPacket</code> by using JSON.stringify(rows). Now my array look like this </p>
  
  <pre><code>[{"FieldName":"aoc_com","Input":"ipc3"},{"FieldName":"build","Input":"RH"},{"FieldName":"daq_type","Input":"Full"},{"FieldName":"endingport","Input":"8030"},{"FieldName":"id_type","Input":"TAM9"},{"FieldName":"od_build_type","Input":"Test_OD"}]
  </code></pre>
  
  <p>Then I store this output in a variable as <code>sysConValues</code> and then when I tried to iterate over the var <code>sysConValues</code></p>
  
  <pre><code>for (var i = 0; i &lt; rows.length; i++) { 
    for (var key in sysConValues[i]) { 
       console.log(sysConValues); 
    }
  }
  </code></pre>
  
  <p>I'm getting output as 0 instead of <code>['FieldName', 'Input']</code>. What I did wrong here and how to get keys from <code>sysConValues</code>. </p>