Referencing this inside objects
<p>I'm having some trouble accessing variables within my object.</p>

<p>I'm getting returned undefined when I try to access the variables.</p>

<p>My code looks like this:</p>

<pre><code>var app = {
  data: function() {
    this.labels = [1, 2, 3, 4, 5];
  },
  barChartData: {
    labels: this.labels, // this is undefined
    datasets: [{
        data: this.data1 // this is undefined
    }, {
        data: this.data2 // this is undefined
    }]
  },

  },
  init: function() {
    this.data();
  }
}
app.init();
</code></pre>