Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!