Promise is an object, which promises the user to get back the values or do some task after performing the promised activity without hampering the main UI. The execution of the other activities will work as normal. So in single word we can say, it is asynchronous.
The JOIN method of the Promise works like a waiter in the restaurant, waiting for the whole order from a table from each person. We can club separate promise objects and join them together. Join ensures to perform a task after all the promise objects finished their execution.
Queries encountered on the above
On all the above, I encountered the query,
- what will happen when any of the Promise gets an error ?
- Will it able to club the output and wait for the promises ? OR it will quite the execution ? Etc. etc.
After some of the homework and trials below are my findings. Continue reading