title: Why is response.json() returning a promise?
body: <p>I have this JavaScript fetch function</p>
  <pre><code>async getAllExpensesByUser() {
      let reponse = await fetch(&quot;router.php/getAll&quot;);
      console.log(reponse.json());
    }
  </code></pre>
  <p>also tried</p>
  <pre><code>getAllExpensesByUser = async () =&gt; {
      const response = await fetch(&quot;router.php/getAll&quot;);
      if (response.ok) {
        const jsonValue = await response.json();
        return Promise.resolve(jsonValue);
      } else {
        return Promise.reject(&quot;*** PHP file not found&quot;);
      }
    };
  </code></pre>
  <p>my router.php file has this code</p>
  <pre><code>   $data = $expensesController-&gt;getExpensesForUser($_SESSION['userid']);
     echo json_encode($data);
  </code></pre>
  <p>but <code>response.json()</code> is returning <code>Promise {&lt;pending&gt;}</code> and the result I need is inside of <code>[[PromiseResult]]</code></p>