title: Run javascript function in sequence
body: <pre><code>function main(){
     function_A();
     function_B();
  }
  function function_A(){
     axios(....).then(res=&gt;{console.log("get response of A")});
  }
  function function_B(){
     axios(....).then(res=&gt;{console.log("get response of B")});
  }
  </code></pre>
  
  <p>Assume that I have a main function to control the flow  of a program, if I cannot edit the function A and B, how can I run them in sequence (function_B should wait function_A response before start)?</p>