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

173
Vistas
How do I store the value returned by the API response in a variable?

showMovies() is a function that gets an array of movie information that holds imdbID, Title, etc. Then for each movie, I have to call a different API call via its IMDbID to fetch more details like the Plot. But if I print Overview inside the fetch it is printing the details correctly

see output

but outside that, it is printing nothing to console

see output.

'Overview' is a global variable

function showMovies(data){
data.forEach(movie => {
    const{Title,Poster,imdbID,Year,Type} = movie;
    url=BASE_SEARCH_MovieInfo+imdbID+API_KEY;
    fetch(url).then(res => res.json()).then(m_data =>{
    Overview = m_data.Plot;
    console.log(Overview);
    // Overview = Plot;
    });

});

}

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