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

96
Vistas
JavaScript Promises vs multi-threaded if-else

I'm hoping someone can help me better understand the need for the Promise feature in JavaScript. To me, they really just seem like asynchronous if-else statements. Having most of my experience in C++, I don't understand what a promise could do that couldn't be done with simpler syntax using an if-else statement running on separate threads.

I'm not trying to criticize the language, and I'm not doubting that there is a good reason for this feature, but I haven't managed to grasp it so far. Having used them in exercises, the code would be much more intuitive to me if I were able to set functions running on separate threads, merge them, and running an if-else statement on their outputs. Why was this language feature added in stead of just giving me control over splitting and merging threads?

Any help would be greatly appreciated. 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