Just to add something to it. Promise.all is good for "all or nothing" situations. If one promise rejects, Promise.all immediately rejects, completely forgetting about the other ones in the list. Their results are ignored.
There is also a similar new method, Promise.allSettled, which is good for "all or some" situation.This one waits for all promises to settle, regardless of the result (error or value).
Good post sam.
Just to add something to it. Promise.all is good for "all or nothing" situations. If one promise rejects, Promise.all immediately rejects, completely forgetting about the other ones in the list. Their results are ignored.
There is also a similar new method, Promise.allSettled, which is good for "all or some" situation.This one waits for all promises to settle, regardless of the result (error or value).
Ah I hadn’t come across allSettled yet! Thanks.