title: Vue.js - Cannot read property 'push' of undefined
body: <p>I have the following but I get error <code>Cannot read property 'push' of undefined</code>:</p>
  
  <pre><code> var vm = new Vue({
          el: '#root',
          data: {
              posts: [],
              newPost: {}
          },
          createPost: function() {
                 axios.post("api/posts/create", this.newPost).then(function (response) {
                      this.posts.push(response.data);
                  })
          }
   });
  </code></pre>
  
  <p>In my network tab in chrome dev tools I can see response.data is clearly an object:</p>
  
  <pre><code>{
    "id": 131,
    "postContent": "&lt;p&gt;test&lt;/p&gt;\n",
  }
  </code></pre>
  
  <p>So why I'm i getting this error?</p>