title: weird error when using javascript async/await syntax
body: <p>I was trying to get a random user from the randomuser api. The code is from my vue frontend.</p>
  <pre><code>// api response
  { info: { // ommited }, results: [ {//random user data} ] }
  
  // this works
  async get_random_user() {
          const url = &quot;https://randomuser.me/api/&quot;;
          const res = await fetch(url);
          const json_data = await res.json();
          const result = json_data.results[0];
          return result; 
      }
  
  // this throws Uncaught (in promise) TypeError: Cannot read property '0' of undefined
  async get_random_user() {
          const url = &quot;https://randomuser.me/api/&quot;;
          const res = await fetch(url);
          const result = await res.json().results[0];
          return result; 
      }
  </code></pre>
  <p>Why the second function doesn't work?
  Thanks.</p>