title: Js foreach for creating table heads
body: <p>I'm using below code for creating table heading dynamically.</p>
  
  <pre><code>var tableHeaders = "&lt;th&gt;No&lt;/th&gt;";
              tableHeaders += "&lt;th&gt;Devices&lt;/th&gt;";
              tableHeaders += "&lt;th&gt;Users&lt;/th&gt;";
      response.forEach(function(entry){ 
                              entry.chartElements.forEach(function(childrenEntry) {
                                tableHeaders += "&lt;th&gt;" + childrenEntry.label + "&lt;/th&gt;";
                              });
                          });
  </code></pre>
  
  <p>Only the <strong>tableHeaders</strong> outside the foreach is working, It is not appending <strong></strong> tag inside the foreach. What i'm doing wrong here.!!!!</p>
  
  <p>Server response</p>
  
  <pre><code>0: Object
        chartElements: [{count: 1
                       label: "Lollipop"
                       totalCount: 0}]
        deviceCount: 1
        deviceName: "Lenovo"
  
  1: Object
      chartElements: [{count: 1
                       label: "Lollipop"
                       totalCount: 0}]
        deviceCount: 1
        deviceName: "Zenfone"
  2: Object
      chartElements: [{count: 1
                       label: "Lollipop"
                       totalCount: 0}]
        deviceCount: 1
        deviceName: "MotoG"
  3: Object
      chartElements: [{count: 1
                       label: "Lollipop"
                       totalCount: 0}]
        deviceCount: 1
        deviceName: "Nexus5
  </code></pre>
  
  <p>"</p>