Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

99
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda