title: Problems with the fetch api on nodejs
body: <p>I am creating an array of objects from an endpoint with the fetch api. Each object in the response contains a new url and I scan this array for new objects. The purpose is to access the endpoint, obtain the urls and access these urls to store your objects and attributes. But when accessing the array with objects and from an index it returns undefined.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let url = [];
  let pokemon = [];
      
  function getPokemons(){
  
      fetch("https://pokeapi.co/api/v2/type/11/")
          .then(async response =&gt;{ 
              await response.json().then(data =&gt; 
                  data.pokemon.forEach(item =&gt; 
                      url.push(item.pokemon.url)
                  )
              )
          }).then( response =&gt; {
  
              url.map(item =&gt; 
                  fetch(item).then(response =&gt;{ 
                      response.json().then(data =&gt; 
                          pokemon.push(data)
                      )
                  })
              )
  
          })
  
  }
  
  getPokemons()
  
  console.log(pokemon[1])</code></pre>
  </div>
  </div>
  </p>