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

203
Vistas
When a recursive function returns itself to a caller, who makes that subsequent call?
async function parentFunction() {
    try {
        await taskFunction(xyz);
        return true;
    } catch (e) {
        console.log(e);
    }
});

async function taskFunction(xyz) {
    try {
        const done = await someAsyncTask(xyz);
        if !(done) {
            return taskFunction(xyz); // recursion
        }
        return true;
    } catch (e) {
        console.log(e);
    }
});

To help me better understand what is going on behind the scenes, when the task function returns itself to the caller (because there are more tasks to complete), behind the scenes, is the task function returning itself to the caller and the caller then makes that subsequent call? Or is the task function calling itself and then returning the boolean through this chain of calls?

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