title: Angular2 forEach cant read property
body: <p>How can I call <code>this.firms</code> within a data <code>forEach()</code>?</p>
  
  <p>I know how to do this in Angular1, but not with my current project in Angular 2.</p>
  
  <p>Currently it works fine outside of the forEach, but not within.</p>
  
  <pre><code> console.log(this.firms[0].name); // works
      var a = 0;
          console.log("--------------");
  
      data.forEach(function (eachObj) {
        console.log("firms check!");
        console.log(this.firms); // not working
        a = a + eachObj.income; 
        eachObj.name = this.firms[data.firmid - 1].name; // wont work
      });
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Cannot read property 'firms' of undefined
  </code></pre>