title: return variables from arrow function [JS]
body: <p>I have this function <strong>getData</strong> which will read in a list of IDs from a JSON file. the list of IDs is stored to the <strong>idsList</strong> variable which i need to use inside another function. How do i return the value from this function</p>
  <pre><code>function getData(){
      fetch(&quot;JSONitemIDsList.json&quot;)
      .then(response =&gt; response.json())
      .then(data =&gt; {
          let idsList = data.ids 
          //return idsList      
      })  
  }
  
  function myFunc(idsList) {
       //do something with idsList
  }
  </code></pre>