title: Call second JavaScript function with getJSON after first one is loaded
body: <p>I have multiple functions with <code>getJSON</code> in it. Can I call/load the second function after the first one is loaded?</p>
  
  <p>Right now the second function is called first and then the first one is loaded. Is there anyway for me to finish loading the first one and then call the second one.</p>
  
  <p>My JavaScript</p>
  
  <pre><code>const functionOne = () =&gt; {
     $.getJSON(api, api_result =&gt; {
        $.getJSON(api2, api2_result =&gt; {
           build Highcharts
        });
     });
  }
  
  const functionTwo = () =&gt; {
     $.getJSON(api3, ap3_result =&gt; {
       build Highcharts
     });
     $.getJSON(api3, api3_result =&gt; {
       ...doSomething
     });
  }
  
  functionOne();
  functionTwo();
  </code></pre>
  
  <p>Right now <code>functionTwo()</code> is loading first (highcharts being drawn) and then <code>functionOne()</code> is being loaded since getJSON is asynchronous. Is there anyway to draw my highcharts in <code>functionOne</code> first and then moving on to <code>functionTwo</code>?</p>