title: js - How to call an async function within a Promise .then()
body: <p>First, I have to mention that I already look through many questions in stackoverflow, but many doesn't answer my question. Not to mention many doesn't even have an answer.</p>
  
  <p>How do I achieve the following, making sure <code>functionB()</code> executes after <code>functionA()</code> finishes?</p>
  
  <p><br><strong>Note: I do not want to convert my async functions to <code>new Promise(resolve=&gt;{...})</code></strong> <br>
  because I'll have to convert the <code>someServiceThatMakesHTTPCall()</code> as well, and any other async functions within the call stack, which is a big change.</p>
  
  <pre><code>  function functionThatCannotHaveAsyncKeyword() {
        functionA()
          .then(async function() {
              await functionB();
          })
          .then(function() {
              console.log('last');
          });
    }
  
    async function functionA() {
        console.log('first');
        await someServiceThatMakesHTTPCall();
    }
  
    async function functionB() {
        console.log('second');
        await someServiceThatMakesHTTPCall();
    }
  </code></pre>