title: How to use data from one hook to other hook in Vue.js?
body: <p>In my <strong>vue.js</strong> application I send request by <strong>axios</strong> package in <code>created()</code> hook. I add response to array called <em>coordinates</em>. I want to use that array outside of <code>created()</code> hook. For example in <code>mounted()</code> hook or in functions which we can set in <code>methods</code>.</p>
  
  <p>Right now when I tried to use <code>self.coordinates</code> outside <code>created()</code> hook it return <code>undefined</code>. When I use <code>this.coordinates</code> it return just <code>[__ob__: Observer]</code>.
  Whats wrong I did?</p>
  
  <pre><code>export default {
      name: "Map",
      data() {
          return {
              coordinates: [],
          }
      },
      created() {
          let self = this;
          axios.get('URL').then(function (response) {
              let coordinates = [];
              for (let i = 0; i &lt; response.data.length; i++) {
                  coordinates.push([response.data[i]["LATITUDE"], response.data[i]["LONGITUDE"]]);
              }
              self.coordinates = coordinates;
          });
      },
      mounted() {
          console.log(self.coordinates); // undefined
          consol.log(this.coordinates);  // [__ob__: Observer]
      },
  }
  </code></pre>