title: Returning an Axios Promise from function
body: <p>Can someone please explain why returning an Axios promise allows for further chaining, but returning after applying a <code>then()/catch()</code> method does not?</p>
  
  <p>Example:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const url = 'https://58f58f38c9deb71200ceece2.mockapi.io/Mapss'
      
  function createRequest1() {
    const request = axios.get(url)
  
    request
    .then(result =&gt; console.log('(1) Inside result:', result))
    .catch(error =&gt; console.error('(1) Inside error:', error))
  
    return request
  }
  
  function createRequest2() {
    const request = axios.get(url)
  
    return request
    .then(result =&gt; console.log('(2) Inside result:', result))
    .catch(error =&gt; console.error('(2) Inside error:', error))
  }
  
  createRequest1()
  .then(result =&gt; console.log('(1) Outside result:', result))
  .catch(error =&gt; console.error('(1) Outside error:', error))
  
  createRequest2()
  .then(result =&gt; console.log('(2) Outside result:', result))
  .catch(error =&gt; console.error('(2) Outside error:', error))</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://unpkg.com/axios@0.16.1/dist/axios.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://jsfiddle.net/nandastone/81zdvodv/1/" rel="noreferrer">https://jsfiddle.net/nandastone/81zdvodv/1/</a></p>
  
  <p>I understand that Promise methods should return a value to be chained, but why is there a difference between these two return methods?</p>