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

159
Vistas
How can i store / pass the data after an api call?

I have a simple problem which wish someone can shed some light on. After I call an external api returning JSON object. I cannot pass the response outside the callback function. and It returns undefined.


let params = {
   key: "value"
  };

function callback (data) {
    return data
}

//calling the external api which return json object
search.json(params, callback);

no matter how i try to store the data it returns undefined except inside the call back function.

my problem is how can i pass the data to a global scope or access the response after i calling the function though import module.

thanks

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