title: How can I await an event listener inside a function?
body: <p>I'm trying to wait for a button to be clicked before proceeding inside another function.</p>
  <pre><code>async function foo() {
      // code before
      await ??? // wait for start button to be clicked before proceeding
      // code after
  }
  
  startButton.addEventListener(&quot;click&quot;, function() {
      return new Promise(); // ???
  }, false);
  </code></pre>
  <p>How can I use an event listener inside another function?</p>