title: Javascript async function inside another function
body: <p>I am trying to call an async function inside another function. However, when I click on the network tab, it ain't creating any post request. What can be the issue here?</p>
  <pre><code>var onComplete = function() {
    // CALLING THE ASYNC FUNCTION HERE ---&gt; { NOT WORKING }
    updateProfile()
  }
  
  async function updateProfile(){
    var dataString = {
      name: questions[0].answer,
      gender: questions[1].answer,
      dob: questions[2].answer,
      country: questions[3].answer,
      interested: questions[4].answer,
    };
    let xhr = new XMLHttpRequest();
    xhr.open(&quot;POST&quot;, &quot;processes/onboard.php&quot;, true);
    xhr.onload = ()=&gt; {
      if(xhr.readyState === XMLHttpRequest.DONE) {
        if(xhr.status === 200) {
          // SUCCESS
        }
      }
    }
    let formData = new FormData(form);
    xhr.send(JSON.stringify(dataString));
  }
  </code></pre>