title: How to fetch an array object from API json file
body: <p>I have a json data and i would like to render only name from there.</p>
  <p>With ${data.people}, i can see {&quot;name&quot;: &quot;Neil Alden Armstrong&quot;, &quot;craft&quot;: &quot;ISS&quot;}
  but i would like to get only names : Neil Alden Armstrong</p>
  <p>Ive tryied ${data.people.name} or {data.name} but both turned undefined.
  How can i get name?</p>
  <p>JSON data</p>
  <pre><code>{
    &quot;message&quot;: &quot;success&quot;, 
    &quot;people&quot;: 
      [
        {&quot;name&quot;: &quot;Neil Alden Armstrong&quot;, &quot;craft&quot;: &quot;ISS&quot;}, 
        {&quot;name&quot;: &quot;Buzz Aldrin&quot;, &quot;craft&quot;: &quot;ISS&quot;}, 
        {&quot;name&quot;: &quot;Sally Kristen Ride&quot;, &quot;craft&quot;: &quot;ISS&quot;}
      ], 
    &quot;number&quot;: 3
  }
  </code></pre>
  <p>js file</p>
  <pre><code>const contentTag = document.getElementById('content');
  fetch(' here is the url of json data ')
    .then(res =&gt; res.json())
    .then(data =&gt; {
      console.log(data)
  
      const jsonToString = JSON.stringify(data.people);
      console.log('jsonToString', jsonToString);
  
      contentTag.textContent = `
      There are ${data.number} astronauts in space, they are:
      ${JSON.stringify(data.people)}
      `;
      console.log(&quot;name&quot;, data.peolpe);
    });
  </code></pre>