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

120
Vistas
What is different this return of promise?

What is different promise here

promise()
.then(
   otherPromise()
)
.catch(error)

and here :

promise()
.then(() => {
   otherPromise()
})
.catch(error)

Someone can help me with explain it

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In the first example, you're passing the return value of calling otherPromise() to your then. In the second example you're passing a function which will call otherPromise() when the then is reached.

For example, lets assume otherPromise() just returns a string like this:

const otherPromise = () => 'Hello World';

In the first example you are passing the string 'Hello World' into your then, in the second you are passing a function in.

I suspect what you want to do is this:

promise()
  .then(otherPromise)
  .catch(error)
about 4 years ago · Juan Pablo Isaza Denunciar
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