Sobes.tech
Junior — Senior

Independent implementation of the Promise.all function

livecode

Task condition

Develop your own version of the Promise.all method, which takes an array (or any iterable object) of promises and returns a new promise. The resulting promise should fulfill successfully when all the input promises are successfully completed, and return an array of their results in the order corresponding to the original set. If at least one of the promises is rejected, the resulting promise should be rejected with that error immediately after it occurs. Do not use the built-in Promise.all in your implementation, but rely only on the basic Promise constructor and the then/catch methods.