title: use variable outside async function javascript
body: <p>i'm trying to get the number of table line using javascript. i'm using php api with javascript.
  from the php side evry thing is good and i get the lines number with the javascript function below. the problem that's i want to use this variable outside this function .</p>
  <p>note : inside function is working</p>
  <pre><code>      const readNumberListe = async () =&gt; {
          const data = await fetch(&quot;action.php?readNumberListe=1&quot;, {
            method: &quot;GET&quot;,
          });
          const response = await data.json();// the response is 5 for exepmle 
          var number = response.number_parent ; 
          console.log(number) ; // i get 5 in the console 
      
        };
        readNumberListe();
  
  // but i want to use or print 'number' here
  </code></pre>