Differences between Promise.all() and Promise.allSettled() in JS?
问题 I was reading the MDN 's manual on Promise , and I found these two methods which seem similar to me: Promise.allSettled(iterable); Promise.all(iterable); Both of them take an iterable and return an array containing the fulfilled Promise s. So, what is the difference between them? 回答1: Promise.all will reject as soon as one of the Promises in the array rejects. Promise.allSettled will never reject - it will resolve once all Promises in the array have either rejected or resolved. Their resolve