title: Problem with pushing json to array and get it back to use it
body: <p>I'm getting my json from single run of CGI script and pushing it into array. In my case it is necessary to have a lot of jsons and then use them. So in my code, I get jsons and finnaly try to draw a chart. Simplier: I need an array of jsons.</p>
  
  <p>I was trying to get the results from forEach nested function, but I had an error: </p>
  
  <blockquote>
    <p>Cannot read property 'forEach' of undefined</p>
  </blockquote>
  
  <p>Here is code from HTTP Request to get json from CGI script and push it into array:</p>
  
  <pre><code>xhttp.onreadystatechange = function() {
     if (this.readyState == 4 &amp;&amp; this.status == 200) {
      var data= this.responseText;
      arrayOfData.push(data);
     }
  </code></pre>
  
  <p>Then I was trying to get first json by forEach and use to draw chart in D3.</p>
  
  <pre><code>var data = arrayOfData[0];
  
   data.forEach(function(d) {
          d.num = d.num;
          d.time_test = d.time_test;
     });
  </code></pre>
  
  <p>But then I have got an error: Cannot read property 'forEach' of undefinded.
  arrayOfData is global variable, so it is not a problem.
  Maybe you know where is..</p>
  
  <p>Thank you for help in advance</p>