Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
i made a map with fetch and split the result, and push to other variable but when i try to acess it return undefined - array[0] = undefined

i made a map with fetch and split the result, and push to other variable but when i try to acess it give's undefined

const arrayPokemons = Array(5)
  .fill()
  .map((item, index) => {
    let hold = [];
    fetch(`https://pokeapi.co/api/v2/pokemon/${index + 1}`)
      .then((res) => res.json())
      .then((data) => {
        hold.push(data.name.split(""));
      });

    console.log(hold, " INTO THE MAP");
    return hold;
  });

console.log(arrayPokemons, "ALL ARRAYS");
console.log(arrayPokemons[0], "SPECIFC ARRAY");
console.log(arrayPokemons[0][0], "SELECTED ARRAY, BUT RETURN undefined");

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda