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

316
Vistas
Return value of nested function to main function in JS undefined problem
chrome.storage.local.set({list : 'list1'});

function get_list() {

  function x() {
    chrome.storage.local.get(['list'], function (res) {
      return res.list;
    });
  }

  return x() ;

}

alert(get_list());

I have read this .But I didn't find any solution

It works very well if I don't use chrome.storage.local.get function in another function .I am used to write code in PHP that's why I am a bit confusing .Why it returns undefined ? Is it something they call "callback hell" ? Actually I created x function for returning response but then realized I created one function again ,I need to return nested function answer to function answer and then call it . Thanks in advance

about 4 years ago · Santiago Trujillo
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