Junior — Senior
Creating your own version of Promise.all
livecode
Task condition
Implement a function that mimics the behavior of the built-in Promise.all. The function takes an array (or any iterable object) of promises or regular values and returns a new promise. This promise fulfills when all the passed elements have successfully completed, and rejects upon the first error. The position of elements in the resulting array should correspond to their order in the input.