title: Javascript forEach - how to loop an object?
body: <p>How can I use forEach to loop an object?</p>
  
  <p>For instance:</p>
  
  <pre><code>var dataset = {
      "data" : {
          "particles" : {},
          "no2" : {},
          "timestamp" : {}
      }
  };
  </code></pre>
  
  <p>js:</p>
  
  <pre><code>dataset.data.forEach(function(field, index) {
      console.log(field);
  });
  </code></pre>
  
  <p>error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: dataset.data.forEach is not a function</p>
  </blockquote>
  
  <p>Any ideas?</p>