title: Second await inside an async function is not working. Uncaught SyntaxError: await is only valid in async functions and the top level bodies of modules
body: <p>I have this function, which is a boilerplate of the fetch method in JavaScript. It is exactly as I learned it and as I have seen in all my search.
  The first await works, response.ok is true, but the second await throws this error. It is the same with any await method instead of this second one.
  &quot;Uncaught SyntaxError: await is only valid in async functions and the top level bodies of modules&quot;.
  This is the function. Thank you all in advance for your help, I am new to JavaScript.</p>
  <pre><code>async function getScoreGET(sitio) {
      try {
  
          const response = await fetch(sitio)
  
          if (response.ok) {
              const jsonResponse = await response.json();
              alert(&quot;Éxito GET&quot;);
              return jsonResponse;
  
          }
      }
      catch (error) {
          alert(&quot;Fallo GET&quot;);
          console.log(error);
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/tJggK.png" rel="nofollow noreferrer">Boilerplate from CodeCademy</a></p>