title: Cannot return the value from a function in AJAX
body: <p>Hi I cannot return the value from the function. It's returns undefined. And I don't know why. Below is the code.</p>
  
  <pre><code>function getData() {
      axios.get('/task')
          .then(response =&gt; {
                return response.data.tasks;
          });
  }
  
  //calls the function
  getData();
  </code></pre>
  
  <p>But when i call the function getTaskData, it returns only undefined.</p>
  
  <p>Please help. Thanks. </p>