title: Cannot read property 'forEach' of undefined in reactjs application
body: <p>I have a JS method that takes a JSON file and try to get information out of it:</p>
  
  <pre><code>getData(json) {
          var output = '';
  
          json.Legs.forEach(function (item) {
              .
              .
              .
              .
              .
              .
          });
  
          return output;
      }
  </code></pre>
  
  <p>I am getting this error for forEach:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'forEach' of undefined</p>
  </blockquote>
  
  <p>Is it possible to use forEach like this or I shouldn't be using forEach at all?
  Is there nother way to do this?</p>