title: How to get the key value inside an array to use to populate dropdown options. Javascript
body: <p>I have an array and I want to load the operatingSystem values as dropdown options.</p>
  
  <pre><code>array = [
  {count: "7", operatingSystem: "MacOS X"},
  {count: "2", operatingSystem: "Windows 2012"},
  {count: "2", operatingSystem: "FreeBSD / MacOS X"},  
  {count: "2", operatingSystem: "Linux 2.2-2.6"},
  {count: "2"}];
  </code></pre>
  
  <p>Here is how I'm doing:</p>
  
  <pre><code>    renderFilterList(array) {
            let array2=[];
          array.map(function(obj, index) {
            Object.keys(obj).forEach(function(val) { 
              array2.push({label: val.groupBy, key: index}); 
            });
          });
  // the above does not work as I'm not getting the value of the key `operatingSystem` inside in the array loop. The value `operatingSystem` is dynamic and is subject to change depending on the data I get.
  
  //following is a internal react component im using to get the values in the dropdown
               &lt;Dropdown
                      placeholder= "Select a value ..."
                      value={value}
                      listItems={array2}
                      key={key}
                      onSelect={this.onGroupValueSelect.bind()} /&gt;
                    &lt;/div&gt;
  
      }
  </code></pre>
  
  <p>In the array2, im trying to obtain this data:</p>
  
  <pre><code> const array2 = [{label: "MacOS X", key:1},
                {label: "Microsoft", key:2},
                {label: "Linux", key:3},
                {label: "Windows", key:4}];
  </code></pre>
  
  <p>how can I get the key value so that I'm able to populate the dropdown options with the values inside the array?
  Any ideas?? Thanks!!</p>