Hello!
I have a problem on Asynchorous Programming section.
Link to this article:
In the “General Asynchorous Programming Concepts” section, this is said
The second problem is that although code run in a worker is not blocking, it is still basically synchronous. This becomes a problem when a function relies on the results of multiple previous processes to function. Consider the following thread diagrams:
Also this about “Promises” is said,
To fix such problems, browsers allow us to run certain operations asynchronously. Features like [Promises] allow you to set an operation running (e.g. the fetching of an image from the server), and then wait until the result has returned before running another operation:
What is the use of promises then? It seems like promises also makes the code synchorous just like the Web Workers for some tasks(e.g. the fetching of an image from the server). What is the special additional feature that promises give?
Thank you.