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

232
Vistas
Does Promise.race rejects the other promises after first fulfillment?

Something that I cannot find the exact answer. In Promise.race after the first fulfillment takes place, do the rest promises keep running or they are rejected?

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

0

The answer is yes, they keep running. You can see the answer yourself

const promise1 = new Promise((resolve, reject) => {
  setTimeout(() => {
    console.log('completing promise1 after 1 sec')
    resolve('one');
  }, 1000);
});

const promise2 = new Promise((resolve, reject) => {
  setTimeout(() => {
    console.log('completing promise2 after .5 sec')
    resolve('two');
  }, 500);
});

Promise.race([promise1, promise2]).then((value) => {
  console.log(value);
  // Both resolve, but promise2 is faster
});

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