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.