title: Typescript How to access component variable in foreach loop?
body: <p>Hey can somebody tell me how I can access a component variable in foreach loop ?
  Here my
  <a href="https://plnkr.co/edit/7M3COcICuL3FMgmX3ZIq?p=preview" rel="noreferrer">Plunker</a></p>
  
  <pre><code> public testVariable:number;
  
    test(){
      console.log('fired');
      var x  =[1,2,3,4];
  
      x.forEach(function (e){
        this.testVariable = e;
      })
  
      console.log( this.testVariable);
    }
  </code></pre>