title: typescript variable with different values
body: <p>I'm using TypeScript with ES6</p>
  <p>Take a look at the following code:</p>
  <pre><code>    private latestPrices: any = {};
  
      public constructor() {
          this.timer = global.setInterval(this.getPricesCallback, 1500);
      }
  
      private getPricesCallback() {
          // tslint:disable-next-line:no-console
          console.log(&quot;Hello&quot;);
  
          // tslint:disable-next-line:no-console
          console.log(this.latestPrices);
  
          this.latestPrices = { &quot;bookname &quot;:&quot;VB BLACK BOOK&quot;, &quot;price&quot;:500 };
  
          // tslint:disable-next-line:no-console
          console.log(this.latestPrices);
      }
  
      public getLatestPrices()
      {
          // tslint:disable-next-line:no-console
          console.log(this.latestPrices);
          return this.latestPrices;
      }
  </code></pre>
  <p>The Output is:</p>
  <pre><code>Hello
  { &quot;bookname &quot;:&quot;VB BLACK BOOK&quot;, &quot;price&quot;:500 }
  { &quot;bookname &quot;:&quot;VB BLACK BOOK&quot;, &quot;price&quot;:500 }
  </code></pre>
  <p>And this every 1.5 seconds... So far so good. But every time I call &quot;getLatestPrices&quot; I only get:</p>
  <pre><code>{}
  </code></pre>
  <p>Why is this?
  I don't see the problem right now.</p>
  <p>Thank you for your help.</p>