Thank you! Sure and I will try to explain here. With the reject if none of the promise is resolved then an Aggregate error is returned as in the example that I intentionally rejected C and D to see the error. In the case of resolve, if any of the promise is resolved in the example A resolves faster than B the result is returned and doesn't care about B. Promise.any() works in opposite way with Promise.all() where all promises need to be resolved for a single promise to resolve. Hope this made more clear when working with promise.any :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi JackyDev,
Thank you! Sure and I will try to explain here. With the reject if none of the promise is resolved then an Aggregate error is returned as in the example that I intentionally rejected C and D to see the error. In the case of resolve, if any of the promise is resolved in the example A resolves faster than B the result is returned and doesn't care about B. Promise.any() works in opposite way with Promise.all() where all promises need to be resolved for a single promise to resolve. Hope this made more clear when working with promise.any :)