title: How to fetch specific array into object using javascript
body: <p>hello I'm trying to fetch data from specific URL but the URL contains tow keys as below</p>
  <pre><code>{&quot;users&quot;:[],&quot;warnings&quot;:[]}
  </code></pre>
  <p>I want to target the users array and  I'm using this approach</p>
  <pre><code>    async function getData(){
  const apiUrl = &quot;https://MyURL&quot;
  const response = await fetch(apiUrl)
  const mydata= await response.json()
  
  
  const firstname= mydata.data.map((x) =&gt; x.users.firstname)
  console.log(firstname);
  }
  
  getData()
  </code></pre>
  <p>The console returns me Cannot read property 'map' of undefined.
  So how to target the specific key?</p>
  <p>Thank you kindly.</p>